Call method and apparatus

ABSTRACT

Embodiments of this application disclose a call method and an apparatus. In the call method, when a user does not actively select an audio device as a voice pickup device and a voice play device, after establishing a call connection to another electronic device, an electronic device selects, from available audio devices, an audio device that meets a user expectation as the voice pickup device and the voice play device. According to technical solutions provided in the embodiments of this application, user experience in a call process can be improved.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a national stage of International Application No.PCT/CN2020/107385, filed on Aug. 6, 2020, which claims priority toChinese Patent Application No. 201910774468.9, filed on Aug. 21, 2019.Both of the aforementioned applications are hereby incorporated byreference in their entireties.

TECHNICAL FIELD

This application relates to the field of terminal technologies, and inparticular, to a call method and an apparatus.

BACKGROUND

During a call, an electronic device such as a mobile phone or a tabletcomputer needs to collect audio of a local user and play audio of a peeruser by using an audio device, so that the users at both the ends cansuccessfully make a call to each other. With development of electronictechnologies, there are increasingly more types of audio devices. Theaudio devices may include an earpiece/receiver (receiver), a speaker(speaker), and a microphone (microphone) that are configured on theelectronic device, a wired headset and a wireless headset that areexternally connected to the electronic device, and the like.

When a plurality of audio devices are available, a user expects thatduring a call, an electronic device can select an appropriate audiodevice to collect audio of a local user and play audio of a peer user.Therefore, a technical solution needs to be provided currently, so thatduring a call, the electronic device can select an appropriate audiodevice to collect audio of a local user and play audio of a peer user,to meet a user expectation and improve user experience.

SUMMARY

This application provides a call method and an apparatus. In the callmethod, an electronic device may select an audio device that meets auser expectation as a voice pickup device and a voice play device, toimprove user experience.

According to a first aspect, an embodiment of this application providesa call method. The method is applied to a first electronic device. Themethod may include: connecting a first electronic device to a firstexternal audio device; in response to a first operation received on thefirst external audio device, performing a first call process between thefirst electronic device and a second electronic device by using thefirst external audio device, where the first external audio device isconfigured to: in the first call process, collect audio around the firstelectronic device, and play audio around the second electronic device;ending the first call process; detecting a second operation entered onthe first electronic device, where the second operation is used toreceive a call request initiated by a third electronic device, or thesecond operation is used to initiate a call request to the thirdelectronic device; and in response to the second operation, if the firstexternal audio device is a default audio device, performing a secondcall process between the first electronic device and the thirdelectronic device by using the first external audio device, where thefirst external audio device is configured to: in the second callprocess, collect audio around the first electronic device, and playaudio around the third electronic device.

According to the method in the first aspect, a user may use an activelyselected external audio device to make a call to a peer user. This meetsa user expectation, to improve user experience.

With reference to the first aspect, in some embodiments, a dial buttonor an answer button is disposed on the first external audio device; andthe first operation includes an operation performed on the dial buttonor an operation performed on the answer button.

According to a second aspect, an embodiment of this application providesa call method. The method is applied to a first electronic device. Themethod may include: A first electronic device performs a third callprocess between the first electronic device and a fourth electronicdevice by using a first audio device, where the first audio device isconfigured to: in the third call process, collect audio around the firstelectronic device, and play audio around the fourth electronic device;detects a third operation used to switch to a second audio device; inresponse to the third operation, continues performing the third callprocess by using the second audio device, where the second audio deviceis configured to: in the third call process, continue collecting audioaround the first electronic device, and continue playing audio aroundthe fourth electronic device; ends the third call process; detects asecond operation entered on the first electronic device, where thesecond operation is used to receive a call request initiated by a thirdelectronic device, or the second operation is used to initiate a callrequest to the third electronic device; and in response to the secondoperation, if the second audio device is a default audio device,performs a second call process between the first electronic device andthe third electronic device by using the second audio device, where thesecond audio device is configured to: in the second call process,collect audio around the first electronic device, and play audio aroundthe third electronic device.

According to the method in the second aspect, a user may use an audiodevice used after the user performs switching to make a call to a peeruser in a call process, and still use the audio device used after theswitching to make a call to the peer user in a next call process. Thismeets a user expectation, to improve user experience.

With reference to the second aspect, in some embodiments, beforedetecting, in the third call process that is between the firstelectronic device and the fourth electronic device and that is performedby the first electronic device by using the first audio device, thethird operation used to switch to a second audio device, the firstelectronic device may further perform the following steps: displaying afirst user interface, where the first user interface includes a controlfor switching an audio device; and displaying one or more audio deviceoptions in response to an operation detected on the control forswitching an audio device, where the one or more audio device optionsinclude an option of an audio device configured on the first electronicdevice and an option of an external audio device to which the firstelectronic device is connected, and the one or more audio device optionsinclude an option of the second audio device; and the third operationused to switch to a second audio device includes an operation performedon the option of the second audio device.

With reference to the first aspect or the second aspect, in someembodiments, after performing the second call process between the firstelectronic device and the third electronic device, the first electronicdevice may further perform the following steps: ending the second callprocess; connecting the first electronic device to a second externalaudio device; detecting a fourth operation entered on the firstelectronic device, where the fourth operation is used to receive a callrequest initiated by a fifth electronic device, or the fourth operationis used to initiate a call request to the fifth electronic device; andin response to the fourth operation, if the second external audio deviceis a default audio device, performing a fourth call process between thefirst electronic device and the fifth electronic device by using thesecond external audio device, where the second external audio device isconfigured to: in the fourth call process, collect audio around thefirst electronic device, and play audio around the fifth electronicdevice. In this manner, the user may use an external audio device lastconnected to the electronic device to make a call to the peer user. Thismeets a user expectation, to improve user experience.

With reference to the first aspect or the second aspect, in someembodiments, after performing the second call process between the firstelectronic device and the third electronic device, the first electronicdevice may further perform the following steps: ending the second callprocess; detecting a fifth operation, where the fifth operation is usedto receive a call request initiated by a sixth electronic device, or thefifth operation is used to initiate a call request to the sixthelectronic device; displaying one or more audio device options and an OKcontrol in response to the fifth operation, where the one or more audiodevice options include an option of an audio device configured on thefirst electronic device and an option of an external audio device towhich the first electronic device is connected, and the one or moreaudio device options include an option of a third audio device; afterdetecting an operation of selecting the option of the third audiodevice, detecting a sixth operation performed on the OK control, and inresponse to the sixth operation, performing a fifth call process betweenthe first electronic device and the sixth electronic device by using thethird audio device, where the third audio device is configured to: inthe fifth call process, collect audio around the first electronicdevice, and play audio around the sixth electronic device; ending thefifth call process; detecting a seventh operation entered on the firstelectronic device, where the seventh operation is used to receive a callrequest initiated by a seventh electronic device, or the seventhoperation is used to initiate a call request to the seventh electronicdevice; and in response to the seventh operation, if the third audiodevice is a default audio device, performing a sixth call processbetween the first electronic device and the seventh electronic device byusing the third audio device, where the third audio device is configuredto: in the sixth call process, collect audio around the first electronicdevice, and play audio around the seventh electronic device. In thismanner, the user may switch an audio device before a call, and still usean audio device used after the switching to make a call to the peer userin a next call process. This meets a user expectation, to improve userexperience.

With reference to the first aspect or the second aspect, in someembodiments, before detecting the second operation entered on the firstelectronic device, the first electronic device may further receive thecall request initiated by the third electronic device, and display asecond user interface in response to the call request, where the seconduser interface includes an answer control and a hang-up control, and thesecond operation includes an operation performed on the answer control.In this case, the first electronic device serves as an end that receivesthe call request initiated by the third electronic device, and acceptsthe call request in response to the second operation, to establish acall connection to the third electronic device and perform the secondcall process.

With reference to the first aspect or the second aspect, in someembodiments, before detecting the second operation entered on the firstelectronic device, the first electronic device may further display athird user interface, where the third user interface includes anidentifier associated with the third electronic device and a dialcontrol, and the second operation includes an operation performed on thedial control. In this case, in response to the second operation, thefirst electronic device initiates the call request to the thirdelectronic device, and after the third electronic device accepts thecall request, establishes a call connection to the third electronicdevice and performs the second call process.

With reference to the first aspect or the second aspect, in someembodiments, the first electronic device may further connect to a newthird external audio device in the second call process that is betweenthe first electronic device and the third electronic device and that isperformed by the first electronic device. If the new third externalaudio device is a default audio device, the first electronic deviceimmediately uses the third external audio device to perform the secondcall process between the first electronic device and the thirdelectronic device.

With reference to the first aspect or the second aspect, in someembodiments, the first electronic device stores one or more prioritiesof one or more audio devices, the one or more audio devices include anaudio device configured on the first electronic device and an externalaudio device to which the first electronic device is connected, and anaudio device with a highest priority is configured to perform a callprocess between the first electronic device and another electronicdevice. The first electronic device may update priorities of all audiodevices with reference to the following several policies.

(1) When the user actively selects an audio device as a voice pickupdevice and a voice play device, the electronic device immediatelyadjusts a priority of the audio device actively selected by the user ina stack to the highest, and other audio devices in the stack are indescending order of priorities. If the audio device actively selected bythe user is a default audio device, the adjustment operation takeseffect continuously. If the audio device actively selected by the useris not a default audio device, the adjustment operation takes effectonly in a current call process. After the current call ends, theelectronic device adjusts the priority of the audio device activelyselected by the user in the stack to a priority after priorities of alldefault audio devices.

For example, in the method in the first aspect, the first electronicdevice may adjust a priority of the first external audio device to thehighest in response to the first operation received on the firstexternal audio device.

(2) When the user switches an audio device and uses, as a voice pickupdevice and a voice play device, an audio device used after theswitching, the electronic device immediately adjusts a priority of theaudio device used after the switching in a stack to the highest, andother audio devices in the stack are in descending order of priorities.If the audio device used after the user performs the switching is adefault audio device, the adjustment operation takes effectcontinuously. If the audio device used after the user performs theswitching is not a default audio device, the adjustment operation takeseffect only in a current call process. After the current call ends, theelectronic device adjusts the priority of the audio device used afterthe user performs the switching in the stack to a priority afterpriorities of all default audio devices.

For example, in the method in the second aspect, the first electronicdevice may adjust a priority of the second audio device to the highestin response to the third operation.

For another example, in the foregoing optional embodiment, the firstelectronic device may adjust a priority of the third audio device to thehighest in response to the sixth operation.

(3) When the electronic device is newly connected to an external audiodevice, if the external audio device to which the electronic device isnewly connected is a default audio device, the electronic device adjustsa priority of the newly connected external audio device in a stack tothe highest, and other audio devices in the stack are in descendingorder of priorities. If the external audio device to which theelectronic device is newly connected is not a default audio device, apriority of the newly connected external audio device in a stack islower than priorities of all default audio devices in the stack.

For example, in the foregoing optional embodiment, after the firstelectronic device is connected to the second external audio device, ifthe second external audio device is the default audio device, the firstelectronic device may adjust a priority of the second external audiodevice to the highest.

With reference to the first aspect or the second aspect, in someembodiments, the default audio device includes an audio device whosemaximum decibel value existing during audio play is less than athreshold. In this way, when the user does not actively select an audiodevice as a voice pickup device and a voice play device, the electronicdevice selects, only from default audio devices, an audio device thatmeets a user expectation as the voice pickup device and the voice pickupdevice, so that user privacy can be prevented from being disclosed, andimpact on other surrounding users can be reduced.

According to a third aspect, an embodiment of this application providesan electronic device. The electronic device is configured to perform thecall method according to the first aspect. The electronic deviceincludes one or more processors, a memory, and a display apparatus. Thememory is coupled to the one or more processors, the memory isconfigured to store computer program code, the computer program codeincludes computer instructions, and the one or more processors invokethe computer instructions to enable the electronic device to perform themethod according to any one of the first aspect or the possibleimplementations of the first aspect. For operations performed by theelectronic device according to the third aspect and beneficial effectsachieved by the electronic device, refer to related descriptionsaccording to any one of the first aspect or the possible implementationsof the first aspect. Details are not described herein again.

According to a fourth aspect, an embodiment of this application providesan electronic device. The electronic device is configured to perform thecall method according to the second aspect. The electronic deviceincludes one or more processors, a memory, and a display apparatus. Thememory is coupled to the one or more processors, the memory isconfigured to store computer program code, the computer program codeincludes computer instructions, and the one or more processors invokethe computer instructions to enable the electronic device to perform themethod according to any one of the second aspect or the possibleimplementations of the second aspect. For operations performed by theelectronic device according to the fourth aspect and beneficial effectsachieved by the electronic device, refer to related descriptionsaccording to any one of the second aspect or the possibleimplementations of the second aspect. Details are not described hereinagain.

According to a fifth aspect, an embodiment of this application providesa computer program product including instructions. When the computerprogram product runs on an electronic device, the electronic device isenabled to perform the method according to any one of the first aspector the possible implementations of the first aspect.

According to a sixth aspect, an embodiment of this application providesa computer-readable storage medium, including instructions. When theinstructions are run on an electronic device, the electronic device isenabled to perform the method according to any one of the first aspector the possible implementations of the first aspect.

According to a seventh aspect, an embodiment of this applicationprovides a computer program product including instructions. When thecomputer program product runs on an electronic device, the electronicdevice is enabled to perform the method according to any one of thesecond aspect or the possible implementations of the second aspect.

According to an eighth aspect, an embodiment of this applicationprovides a computer-readable storage medium, including instructions.When the instructions are run on an electronic device, the electronicdevice is enabled to perform the method according to any one of thesecond aspect or the possible implementations of the second aspect.

According to the technical solutions provided in the embodiments of thisapplication, when the user does not actively select an audio device as avoice pickup device and a voice play device, after establishing a callconnection to another electronic device, the electronic device selects,from available audio devices, an audio device that meets a userexpectation as the voice pickup device and the voice play device, toimprove user experience.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1A is a schematic flowchart in which an electronic device based onan iOS software system selects a voice pickup device and a voice playdevice according to the conventional technology;

FIG. 1B is a schematic flowchart in which an electronic device based onan Android software system selects a voice pickup device and a voiceplay device according to the conventional technology;

FIG. 2A, FIG. 2B, FIG. 3, FIG. 4a and FIG. 4b , FIG. 5A to FIG. 5D, andFIG. 6A to FIG. 6H are schematic diagrams of human-computer interactionaccording to an embodiment of this application;

FIG. 7A to FIG. 7E are schematic diagrams of stack update according toan embodiment of this application;

FIG. 8 is a schematic flowchart of a call method according to anembodiment of this application;

FIG. 9 is a schematic flowchart of another call method according to anembodiment of this application;

FIG. 10A is a schematic diagram of a structure of an electronic deviceaccording to an embodiment of this application; and

FIG. 10B is a block diagram of a software architecture of an electronicdevice according to an embodiment of this application.

DESCRIPTION OF EMBODIMENTS

The following describes technical solutions in the embodiments of thisapplication with reference to the accompanying drawings in theembodiments of this application.

In the descriptions of the embodiments of this application, unlessotherwise specified, “/” means “or”. For example, A/B may represent A orB. In this specification, “and/or” describes only an associationrelationship between associated objects and represents that threerelationships may exist. For example, A and/or B may represent thefollowing three cases: Only A exists, both A and B exist, and only Bexists. In addition, in the descriptions in the embodiments of thisapplication, “a plurality of” means two or more.

The following terms “first” and “second” are merely intended for apurpose of description, and shall not be understood as an indication orimplication of relative importance or implicit indication of a quantityof indicated technical features. Therefore, a feature limited by “first”or “second” may explicitly or implicitly include one or more features.In the descriptions of the embodiments of this application, unlessotherwise specified, “a plurality of” means two or more.

After an electronic device establishes a call connection to anotherelectronic device, the electronic device may perform a call processbetween the electronic device and the another electronic device based onthe call connection. The call process between the electronic device andthe another electronic device includes: The electronic device collectslocal audio, transmits the local audio to the another electronic device,receives peer audio of the another electronic device, and plays the peeraudio. The call process enables a plurality of users to successfullycall each other. There may be one or more other electronic devices thatestablish a call connection to the electronic device.

In a call process, an audio device configured to collect local audio maybe referred to as a voice pickup device, and an audio device configuredto play peer audio may be referred to as a voice play device.

The local audio includes an ambient sound around the electronic device,and the ambient sound may include a voice of a local user. The peeraudio includes an ambient sound around another electronic device thatestablishes a call connection to the electronic device, and the ambientsound may include a voice of a peer user.

FIG. 1A is a schematic flowchart in which an electronic device based onan iOS software system selects a voice pickup device and a voice playdevice according to the conventional technology.

As shown in FIG. 1A, when receiving a call request from anotherelectronic device, the electronic device may establish a call connectionto the another electronic device in response to a tap operationperformed on an answer control on a display or a slide operation on thedisplay. After establishing the call connection, if a wired headset isconnected to the electronic device, the electronic device selects thewired headset as a voice pickup device and a voice play device. If awired headset is not connected to the electronic device, the electronicdevice selects a microphone configured on the electronic device as avoice pickup device, and selects an earpiece (receiver) configured onthe electronic device as a voice play device.

A manner in which the electronic device selects the voice pickup deviceand the voice play device shown in FIG. 1A does not meet a userexpectation, and therefore user experience is affected. For example, auser always wears a wireless headset and expects to make a call by usingthe wireless headset. However, after receiving the tap operation enteredby the user on the answer control on the display, the electronic devicedoes not select the wireless headset as the voice pickup device and thevoice play device, but selects the connected wired headset as the voicepickup device and the voice play device.

FIG. 1B is a schematic flowchart in which an electronic device based onan Android software system selects a voice pickup device and a voiceplay device according to the conventional technology.

As shown in FIG. 1B, when receiving a call request from anotherelectronic device, the electronic device may establish a call connectionto the another electronic device in response to a tap operationperformed on an answer control on a display or a slide operation on thedisplay. After establishing the call connection, the electronic deviceselects a voice pickup device and a voice play device in a sequence of awireless headset, a wired headset, and a microphone and an earpiece(receiver) that are configured on the electronic device.

A manner in which the electronic device selects the voice pickup deviceand the voice play device shown in FIG. 1B does not meet a userexpectation, and therefore user experience is affected. For example, auser always wears the wired headset and expects to make a call by usingthe wired headset. However, after receiving the tap operation entered bythe user on the answer control on the display, the electronic devicedoes not select the wired headset as the voice pickup device and thevoice play device, but selects the connected wireless headset as thevoice pickup device and the voice play device.

Based on disadvantages of the conventional technology, an embodiment ofthis application provides a call method and an apparatus. When a userdoes not actively select an audio device as a voice pickup device and avoice play device, after establishing a call connection to anotherelectronic device, an electronic device selects, from available audiodevices, an audio device that meets a user expectation as the voicepickup device and the voice play device. According to the technicalsolutions provided in this embodiment of this application, when the usermakes a call, the electronic device may select, from the available audiodevices, the audio device that meets the user expectation to collectlocal audio and play peer audio, to improve user experience.

In the following embodiments of this application, the electronic devicesmay make a voice call or a video call based on the established callconnection. The voice call means that the electronic devices transmit avoice to each other based on the call connection, and the video callmeans that the electronic devices transmit a voice and a real-time imageto each other based on the call connection. In the following embodimentsof this application, the call connection established between theelectronic devices may include but is not limited to the following:

1. The electronic device runs a phone application and the callconnection established between the electronic device and the anotherelectronic device by using a subscriber identification module(subscriber identity module, SIM) number of the another electronicdevice, that is, a call connection established based on a phone serviceprovided by an operator.

2. The electronic device runs an instant messaging application and thecall connection established between the electronic device and theanother electronic device, that is, a network-based call connection. Theinstant messaging application may include FaceTime, Skype, WeChat(WeChat), QQ, or the like. For example, the electronic device runs aconnection established when WeChat (WeChat) initiates a voice call or avideo call to the another electronic device.

In some embodiments of this application, the electronic device may be anend that initiates a call request. After the another electronic devicethat receives the call request accepts the call request, a callconnection is successfully established between the electronic devices.In some other embodiments of this application, the electronic device mayalternatively be an end that receives a call request initiated by theanother electronic device. After the electronic device accepts the callrequest initiated by the another electronic device, a call connection issuccessfully established between the electronic devices.

In the following embodiments of this application, the voice pickupdevice and the voice play device that may be selected by the electronicdevice, that is, the voice pickup device and the voice play device thatare available to the electronic device, may include the following types:

1. An Audio Device Configured on the Electronic Device

(1) One or more microphones (microphone) configured on the electronicdevice, for example, a primary microphone disposed at the bottom of amobile phone or a microphone disposed at the top of the mobile phone,where the microphone is a voice pickup device.

(2) An earpiece (receiver) configured on the electronic device, wherethe earpiece may also be referred to as a receiver, and the earpiece isa voice play device.

(3) A speaker (speaker) configured on the electronic device, where thespeaker is a voice play device.

In this embodiment of this application, when the electronic device usesthe earpiece as the voice play device, the electronic device also usesthe microphone as the voice pickup device. Similarly, when theelectronic device uses the speaker as the voice play device, theelectronic device also uses the microphone as the voice pickup device.

2. An External Audio Device to which the Electronic Device is Connectedin a Wired Manner

The electronic device may establish a wired connection to the externalaudio device through a data interface (for example, a Type-C interface,a USB interface, a 3.5 mm headset interface, or a 2.5 mm headsetinterface) disposed on the electronic device. The external audio deviceto which the electronic device is connected in a wired manner mayinclude a Type-C wired headset, a 3.5 mm wired headset, a 2.5 mm wiredheadset, a USB wired speaker, another audio device, or the like.

In some embodiments, apparatuses such as a microphone and a speaker maybe configured on the external audio device to which the electronicdevice is connected in a wired manner. Therefore, the external audiodevice to which the electronic device is connected in a wired manner maybe used as both a voice play device and a voice pickup device.

It may be understood that there may be one or more external audiodevices to which the electronic device is connected in a wired manner.

In this embodiment of this application, when the electronic device usesthe external audio device connected in a wired manner as the voicepickup device, the external audio device is specifically configured to:collect local audio, and send the local audio to the electronic devicein a wired manner. When the electronic device uses the external audiodevice connected in a wired manner as the voice play device, theexternal audio device is specifically configured to: receive, in a wiredmanner, peer audio sent by the electronic device, and play the peeraudio.

3. An External Audio Device to which the Electronic Device is Connectedin a Wireless Manner

The electronic device may establish a wireless connection to theexternal audio device by using a Bluetooth technology, or may establisha wireless connection to the external audio device in an infraredmanner, a Wi-Fi manner, or another manner. The external audio device towhich the electronic device is connected in a wireless manner mayinclude but is not limited to a wireless headset (for example, aBluetooth headset), a wireless speaker (for example, a Bluetooth speakeror a Wi-Fi speaker), a smart wearable device (for example, a smart watchor a smart band), a vehicle-mounted device, a smart television, or thelike.

In some embodiments, apparatuses such as a microphone and a speaker maybe configured on the external audio device to which the electronicdevice is connected in a wireless manner. Therefore, the external audiodevice to which the electronic device is connected in a wireless mannermay be used as both a voice play device and a voice pickup device.

It may be understood that there may be one or more external audiodevices to which the electronic device is connected in a wirelessmanner.

In this embodiment of this application, when the electronic device usesthe external audio device connected in a wireless manner as the voicepickup device, the external audio device is specifically configured to:collect local audio, and send the local audio to the electronic devicein a wireless manner. When the electronic device uses the external audiodevice connected in a wireless manner as the voice play device, theexternal audio device is specifically configured to: receive, in awireless manner, peer audio sent by the electronic device, and play thepeer audio.

In the following embodiments of this application, the electronic devicemay be connected to one or more external audio devices in both a wiredmanner and a wireless manner.

The following describes a case in which the user actively selects theaudio device as the voice pickup device and the voice play device, and acase in which the user does not actively select the audio device as thevoice pickup device and the voice play device.

In the following embodiments of this application, before or when theelectronic device establishes a call connection to another electronicdevice, the user may actively select the audio device as the voicepickup device and the voice play device. In the embodiments of thisapplication, audio devices actively selected by the user as voice pickupdevices and voice play devices are external audio devices connected tothe electronic device.

In the embodiments of this application, the user may actively select theaudio device as the voice pickup device and the voice play device in thefollowing two cases.

1. When the electronic device serves as an end that initiates a callrequest, the user may enter a user operation on an external audio deviceto which the electronic device is connected, to actively select theexternal audio device as the voice pickup device and the voice playdevice.

Specifically, the user may enter the user operation on the externalaudio device to which the electronic device is connected. Afterdetecting the user operation, the external audio device may send asignal to the electronic device, where the signal is used to indicatethat the external audio device detects the user operation. Afterreceiving the signal, the electronic device may initiate a call requestto another electronic device in response to the user operation. Afterthe another electronic device accepts the call request, the electronicdevice establishes a call connection to the another electronic device.After establishing the call connection, the electronic device uses theexternal audio device that receives the user operation as the voicepickup device and the voice play device. Herein, the external audiodevice that receives the user operation may be an external audio deviceto which the electronic device is connected in a wired manner, or may bean external audio device to which the electronic device is connected ina wireless manner.

The user operation entered by the user on the external audio device towhich the electronic device is connected may be considered as anoperation used to actively select the audio device as the voice pickupdevice and the voice play device.

In Case 1, the user operation entered by the user on the external audiodevice to which the electronic device is connected may include but isnot limited to an operation (for example, a double-tap operation or atouch and hold operation) entered on a dial button of the external audiodevice (for example, a Bluetooth headset or a wired headset), or agesture or a voice instruction that is entered on the external audiodevice and that is used to trigger the electronic device to initiate acall request. The dial button may be a physical button or a virtualbutton.

FIG. 2A shows an example of a schematic diagram of a scenario in whichan electronic device is connected to a wired headset in a wired mannerand is connected to a Bluetooth headset in a wireless manner. In someembodiments, the user may enter a double-tap operation on a dial buttonof the Bluetooth headset, and the electronic device may initiate, inresponse to the operation, a call connection to another electronicdevice that has last initiated a call connection, and select theBluetooth headset as a voice pickup device and a voice play device inresponse to the operation. In some other embodiments, the user may entera double-tap operation on a dial button of the wired headset, and theelectronic device may initiate, in response to the operation, a callconnection to another electronic device that has last initiated a callconnection, and select the wired headset as a voice pickup device and avoice play device in response to the operation. It may be understoodthat FIG. 2A shows a scenario in which the electronic device selects thewired headset as the voice pickup device and the voice play device inresponse to the double-tap operation entered by the user on the dialbutton of the wired headset.

2. When the electronic device serves as an end that receives a callrequest, the user may enter a user operation on an external audio deviceto which the electronic device is connected, to actively select theexternal audio device as the voice pickup device and the voice pickupdevice.

Specifically, when the electronic device receives a call request fromanother electronic device, the user may enter the user operation on theexternal audio device to which the electronic device is connected. Afterdetecting the user operation, the external audio device may send asignal to the electronic device, where the signal is used to indicatethat the external audio device detects the user operation. Afterreceiving the signal, the electronic device may accept the call requestin response to the user operation, to establish a call connection to theanother electronic device. After establishing the call connection, theelectronic device collects audio of the user and plays audio of a peeruser by using the external audio device that receives the useroperation. Herein, the external audio device that receives the useroperation may be an external audio device to which the electronic deviceis connected in a wired manner, or may be an external audio device towhich the electronic device is connected in a wireless manner.

In Case 2, the user operation entered by the user on the external audiodevice to which the electronic device is connected may include but isnot limited to an operation (for example, a touch operation or a tapoperation) entered on an answer button of the external audio device (forexample, a Bluetooth headset, a wired headset, a smart watch, or a smartband), or a gesture or a voice instruction that is entered on theexternal audio device and that is used to trigger the electronic deviceto accept a call request. The answer button may be a physical button ora virtual button.

FIG. 2B shows an example of a schematic diagram of a scenario in whichan electronic device is connected to a wired headset in a wired mannerand is connected to a Bluetooth headset in a wireless manner. In someembodiments, when the electronic device receives a call request fromanother electronic device, the user may enter a tap operation on ananswer button of the Bluetooth headset, and the electronic device mayaccept the call request in response to the operation, and select theBluetooth headset as a voice pickup device and a voice play device inresponse to the operation. In some other embodiments, when theelectronic device receives a call request from another electronicdevice, the user may enter a tap operation on an answer button of thewired headset, and the electronic device may accept the call request inresponse to the operation, and select the wired headset as a voicepickup device and a voice play device in response to the operation. Itmay be understood that FIG. 2B shows a scenario in which the electronicdevice selects the Bluetooth headset as the voice pickup device and thevoice play device in response to the tap operation entered by the useron the answer button of the Bluetooth headset.

In the embodiments of this application, the user may not actively selectthe audio device as the voice pickup device and the voice play device inthe following two cases.

1. In response to an operation entered by the user on the electronicdevice, the electronic device serves as an end that initiates a callrequest to initiate a call request to another electronic device. Afterthe another electronic device accepts the call request, the electronicdevice establishes a call connection to the another electronic device.In this case, the user does not actively select the audio device as thevoice pickup device and the voice play device. After establishing thecall connection, the electronic device needs to select, from availableaudio devices, an audio device that meets a user expectation as thevoice pickup device and the voice play device.

Herein, the operation entered by the user on the electronic device mayinclude but is not limited to an operation (for example, a tap operationor a touch operation) entered on a display of the electronic device, aninput voice instruction or gesture used to initiate a call request, orthe like.

FIG. 3 shows an example of a user interface 31 displayed by anelectronic device on a display. The user interface 31 may be provided bya phone application installed on the electronic device. As shown in FIG.3, the user interface 31 includes a dial pad and a dial control 301. Theuser may enter, by using the dial pad, a phone number (for example,“1521518XXXX”) of a user to which the user expects to make a call, andthen enter an operation (for example, a tap operation or a touchoperation) on the dial control 301. In response to the operation enteredby the user on the dial control 301, the electronic device initiates acall request to another electronic device corresponding to the phonenumber.

In addition to the user interface 31 shown in FIG. 3, the electronicdevice may further initiate a call request to the another electronicdevice in response to an operation detected on another user interfaceprovided by a phone application. The another user interface may include,for example, an interface used to display a call record, an interfaceused to display contact details, or the like.

In addition to the phone application shown in FIG. 3, the electronicdevice may further run an instant messaging application, and provide acorresponding user interface, for example, an interface used to displaya status of communication with another contact. The user may enter anoperation in the user interface, and the electronic device may initiate,in response to the operation, a call request to another electronicdevice corresponding to the another contact.

2. When the electronic device serves as an end that receives a callrequest, in response to an operation entered on the electronic device,the electronic device accepts a call request initiated by anotherelectronic device, to establish a call connection to the anotherelectronic device. In this case, the user does not actively select theaudio device as the voice pickup device and the voice play device. Afterestablishing the call connection, the electronic device needs to select,from available audio devices, an audio device that meets a userexpectation as the voice pickup device and the voice play device.

Herein, the operation entered on the electronic device may include butis not limited to an operation entered on a display of the electronicdevice, an input voice instruction or gesture used to accept a callrequest, or the like.

FIG. 4a and FIG. 4b each show an example of a user interface displayedby an electronic device on a display.

A user interface 41 shown in FIG. 4a is an interface displayed when theelectronic device receives, in a screen-locked state, a call requestinitiated by another electronic device based on a phone service providedby an operator. As shown in the figure, the user may enter a slideoperation in the user interface 41. For a track of the slide operation,refer to a track shown in the figure. In response to the slideoperation, the electronic device accepts the call request initiated bythe another electronic device, to establish a call connection to theanother electronic device.

A user interface 42 shown in FIG. 4b is an interface displayed when theelectronic device receives, in an unlocked state, a call requestinitiated by another electronic device based on a phone service providedby an operator. As shown in the figure, the user may enter an operation(for example, a tap operation or a touch operation) on an answer control401 in the user interface 42. In response to this operation, theelectronic device accepts the call request initiated by the anotherelectronic device, to establish a call connection to the anotherelectronic device.

In addition to the call request initiated based on the phone serviceprovided by the operator shown in FIG. 4a and FIG. 4b , when receiving anetwork-based call request, the electronic device may further accept, inresponse to an operation entered on the electronic device, a callrequest initiated by another electronic device, to establish a callconnection to the another electronic device. The network-based callrequest may include, for example, a call request initiated by theanother electronic device by using an instant messaging application.

When the user does not actively select the audio device as the voicepickup device and the voice play device, that is, after the electronicdevice establishes the call connection to the another electronic devicein the manner shown in FIG. 3 and FIG. 4, the following embodimentsdescribe in detail how to select an audio device that meets a userexpectation as the voice pickup device and the voice pickup device.

In the embodiments of this application, when the user does not activelyselect the audio device as the voice pickup device and the voice playdevice, the electronic device selects, only from default audio devices,an audio device that meets a user expectation as the voice pickup deviceand the voice pickup device, to avoid disclosing user privacy and reduceimpact on other surrounding users.

For example, the default audio devices may include an earpiece(receiver) configured on the electronic device, and a wired headset (forexample, a Type-C wired headset, a 3.5 mm/2.5 mm wired headset), aBluetooth headset, a Bluetooth speaker, and a Bluetooth vehicle-mounteddevice that are connected to the electronic device, and the like.Non-default audio devices may include a speaker (speaker) configured onthe electronic device, and a USB speaker, a Wi-Fi speaker, a Wi-Fiset-top box, a Wi-Fi television, a Bluetooth watch, and a Bluetooth bandthat are connected to the electronic device, and the like.

The following describes in detail a reason why each audio device in theforegoing example is considered as the default audio device or thenon-default audio device and a manner in which the electronic deviceidentifies the default audio device and the non-default audio device.

1. In a specific implementation, an audio device whose maximum decibelvalue existing during voice play is less than a threshold may be used asthe default audio device, to avoid disclosing user privacy and reduceimpact on other surrounding users. A maximum decibel value existing whenan earpiece (receiver) plays a voice is less than the threshold.Therefore, the earpiece (receiver) is the default audio device. Amaximum decibel value existing when a speaker (speaker) or the likeplays a voice is greater than the threshold. Therefore, the speaker(speaker) is the non-default audio device.

2. A Bluetooth headset, a Bluetooth speaker, and a Bluetoothvehicle-mounted device that are connected to the electronic devicethrough Bluetooth are the default audio devices, and a Bluetooth watchand a Bluetooth band that are connected to the electronic device throughBluetooth are the non-default audio devices.

Specifically, after the electronic device is connected to an externalaudio device through Bluetooth, because a related protocol of theBluetooth technology does not specify that the external audio deviceneeds to notify the electronic device of a device type (for example, aheadset, a speaker, or a vehicle-mounted device) of the external audiodevice, if the electronic device does not actively query the type of theexternal audio device, the electronic device cannot determine the typeof the external audio device.

In some embodiments, after the electronic device is connected to someexternal audio devices (for example, a Bluetooth headset, a Bluetoothspeaker, and a Bluetooth vehicle-mounted device) through Bluetooth,interaction between the electronic device and the external audio deviceis simple, for example, only audio transmission is involved. In thiscase, the electronic device usually does not learn of a type of theconnected external audio device. A maximum decibel value existing whenthe Bluetooth headset plays a voice is less than a threshold, and theBluetooth headset is an audio device with high usage. The Bluetoothheadset may also be used as the default audio device, to avoiddisclosing user privacy and reduce impact on other surrounding users.The Bluetooth headset, the Bluetooth speaker, and the Bluetoothvehicle-mounted device may all be included in the default audio devices,to ensure that the default audio device includes the Bluetooth headset.

In some other embodiments, after the electronic device is connected tosome external audio devices (for example, a Bluetooth watch and aBluetooth band) through Bluetooth, interaction between the electronicdevice and the external audio device is complex, for example, audiotransmission and data exchange are involved. In this case, theelectronic device may determine a type of the external audio device byinteracting with the external audio device, and learn that the connectedexternal audio device is the Bluetooth watch or the Bluetooth band.Because a maximum decibel value existing when the Bluetooth watch or theBluetooth band plays a voice is large, neither the Bluetooth watch northe Bluetooth band is the default audio device.

3. A Type-C wired headset and a 3.5 mm/2.5 mm wired headset are thedefault audio devices, and a USB speaker is the non-default audiodevice.

After being connected to an external audio device in a wired manner, theelectronic device may communicate with the external audio device througha connected interface. The electronic device may determine a type of theexternal audio device through the interface. Usually, an external audiodevice connected to the electronic device through a Type-C interface isa Type-C headset, an external audio device connected to the electronicdevice through a USB port is a USB speaker, and an external audio deviceconnected to the electronic device through a 3.5 mm headset interface ora 2.5 mm headset interface is a headset. Because a maximum decibel valueexisting when the headset plays a voice is less than a threshold, theheadset connected to the electronic device through the Type-C interface,the 3.5 mm headset interface, or the 2.5 mm headset interface is thedefault audio device. Because a decibel value existing when the USBspeaker plays a voice is large, the USB speaker is the non-default audiodevice.

4. A Wi-Fi speaker, a Wi-Fi set-top box, and a Wi-Fi television are thenon-default audio devices.

An external audio device to which the electronic device is connectedthrough Wi-Fi may include the Wi-Fi speaker, the Wi-Fi set-top box, theWi-Fi television, or the like. The Wi-Fi speaker, the Wi-Fi set-top box,the Wi-Fi television, and the like may be connected to one or moreelectronic devices through Wi-Fi, and are not controlled by only oneelectronic device. Therefore, the Wi-Fi speaker, the Wi-Fi set-top box,and the Wi-Fi television are the non-default audio devices, to avoiddisclosing user privacy. In a specific implementation, the electronicdevice may consider all devices connected through Wi-Fi as thenon-default audio devices.

When the user does not actively select the audio device as the voicepickup device and the voice play device, the following describes indetail several policies used when the electronic device selects, fromdefault audio devices, an audio device that meets a user expectation asthe voice pickup device and the voice play device.

(1) When no external audio device is connected, the electronic deviceselects an earpiece (receiver) configured on the electronic device asthe voice play device, and selects a microphone configured on theelectronic device as the voice pickup device.

(2) When an external audio device is connected, the electronic deviceselects, as the voice pickup device and the voice play device, anexternal audio device that is last connected and that is the defaultaudio device.

An occasion on which the electronic device is last connected to theexternal audio device is not limited in this embodiment of thisapplication. The electronic device may be connected to the externalaudio device before establishing a call connection to another electronicdevice, after establishing a call connection to the another electronicdevice, or in a call process between the electronic device and theanother electronic device.

For example, refer to FIG. 5A. A user interface 51 shown in FIG. 5A isan image displayed when the electronic device receives, in ascreen-locked state, a call request initiated by another electronicdevice. FIG. 5B is a schematic diagram of a scenario in which anelectronic device is newly connected to a Bluetooth headset whenreceiving a call request. Refer to FIG. 5C and FIG. 5D. In response to aslide operation detected in the user interface 51, the electronic devicemay establish a call connection to another electronic device thatinitiates a call request, and select a Bluetooth headset that is lastconnected as a voice pickup device and a voice play device.

Refer to FIG. 5D. A user interface 52 shown in FIG. 5D is an imagedisplayed after an electronic device establishes a call connection toanother electronic device. As shown in FIG. 5D, the user interface 52may include an icon 501 used to indicate a voice pickup device and avoice play device that are currently used by the electronic device. Forexample, the icon 501 may be a Bluetooth icon, and is used to indicatethat the voice pickup device and the voice play device that arecurrently used by the electronic device are a Bluetooth device. Inaddition to the icon shown in FIG. 5D, the electronic device may furtherindicate, by using another visual element, the voice pickup device andthe voice play device that are currently used by the electronic device,for example, may further indicate, by using a text, the voice pickupdevice and the voice play device that are currently used by theelectronic device.

In addition to an example of a scenario in which the electronic deviceserves as an end that receives the call request that is shown in FIG. 5Ato FIG. 5D, when the electronic device serves as an end that initiates acall request, if the user does not actively select an audio device as avoice pickup device and a voice play device, the electronic device mayalso select the voice pickup device and the voice pickup device by usingPolicy (2).

According to Policy (2), the user may use an external audio device lastconnected to the electronic device to make a call to a peer user. Thismeets a user expectation, to improve user experience.

(3) If the user has actively selected an audio device as the voicepickup device and the voice play device, and an audio device last andactively selected by the user is the default audio device, theelectronic device selects the audio device as the voice pickup deviceand the voice play device.

Specifically, for a case in which the user actively selects the audiodevice as the voice pickup device and the voice play device, refer torelated descriptions in the foregoing embodiments.

For example, when the electronic device previously receives a callrequest, the user taps an answer button of a Bluetooth headset. In thiscase, the electronic device establishes a call connection to anotherelectronic device that initiates the call request, and uses theBluetooth headset as the voice pickup device and the voice play devicein the previous call process. The Bluetooth headset is the default audiodevice.

After the electronic device ends a previous call process, if the userinitiates a call request to another electronic device in the mannershown in FIG. 3, or if the user accepts, in the manner shown in FIG. 4,a call request initiated by another electronic device, the electronicdevice uses a Bluetooth headset last and actively selected by the useras the voice pickup device and the voice play device in a current callprocess.

According to Policy (3), the user may use an external audio device thathas been actively selected to make a call to a peer user. This meets auser expectation, to improve user experience.

(4) If the user has adjusted an audio device and uses, as the voicepickup device and the voice play device, an audio device used after theadjustment, and an audio device used after the user performs lastadjustment is the default audio device, the electronic device selectsthe audio device as the voice pickup device and the voice play device.

The user may adjust the audio device as the voice pickup device and thevoice play device in the following two manners.

(1) The user may adjust or switch a currently used voice pickup deviceand voice play device in a call process.

FIG. 6A to FIG. 6C are schematic diagrams of a scenario in which a useradjusts or switches a currently used voice pickup device and voice playdevice in a call process.

FIG. 6A shows a user interface 61 displayed by an electronic device in aprevious call process. As shown in the figure, the user interface 61includes an icon 601 used to indicate a voice pickup device and a voiceplay device that are used by the electronic device and a control 602.

Both the icon 601 and the control 602 may be used to listen to anoperation (for example, a touch operation) used to view a currentlyavailable audio device. Refer to FIG. 6B. In response to an operationreceived on the icon 601 or the control 602, the electronic devicedisplays, in the user interface 61, a list 603 of audio devicescurrently available to the electronic device, where the list 603includes icons and/or texts of audio devices (for example, a speaker andan earpiece) configured on the electronic device, and icons and/or textsof external audio devices (for example, a Bluetooth headset and a wiredheadset) connected to the electronic device.

The icon and/or the text in the list 603 may be used to listen to a useroperation (for example, a touch operation). In response to the useroperation, the electronic device uses an audio device corresponding tothe icon and/or the text as a voice pickup device and a voice playdevice.

Refer to FIG. 6C. In response to an operation detected on the text ofthe wired headset that is in the list 603 shown in FIG. 6B, theelectronic device switches the voice pickup device and the voice playdevice from the Bluetooth headset to the wired headset. In addition tothe switching manner shown in FIG. 6A to FIG. 6C, the user may furtherswitch the voice pickup device and the voice play device in anothermanner. For example, the electronic device may further switch the voicepickup device and the voice play device in response to a voiceinstruction entered by the user.

Refer to FIG. 6D. After the call process shown in FIG. 6A to FIG. 6Cends, in a next call process, if the user does not actively select anaudio device as a voice pickup device and a voice play device, theelectronic device selects, as the voice pickup device and the voice playdevice, an audio device (that is, the wired headset) used after the userperforms last switching.

(2) Before the electronic device establishes a call connection toanother electronic device, the user may adjust or switch a voice pickupdevice and a voice play device that are to be used by the electronicdevice in a call process.

FIG. 6E to FIG. 6H are schematic diagrams of a scenario in which beforean electronic device initiates a call request to another electronicdevice, a user adjusts or switches a voice pickup device and a voiceplay device that are to be used by the electronic device in a callprocess.

FIG. 6E shows a user interface 61 displayed by an electronic device on adisplay. The user interface 61 is the same as the user interface 31shown in FIG. 3. For details, refer to the related descriptions.

Refer to FIG. 6F. In some embodiments, when the electronic devicereceives an operation (for example, a tap operation or a touchoperation) entered on a control 301 in the user interface 31, theelectronic device may display, in the user interface 31, a list 604 ofaudio devices currently available to the electronic device, where thelist 604 includes icons and/or texts of audio devices (for example, aspeaker and an earpiece) configured on the electronic device, iconsand/or texts of external audio devices (for example, a Bluetooth headsetand a wired headset) connected to the electronic device, and a control604A.

The electronic device may prompt the user with a voice pickup device anda voice play device that are to be used by the electronic device in aprocess of a call to be made to another user. Refer to FIG. 6F. Theelectronic device may display, in bold, the icon of the Bluetoothheadset and/or a circle on the right side of the text, to notify theuser that the electronic device is to use the Bluetooth headset as thevoice pickup device and the voice play device in the process of the callto be made to the another user.

After learning that the electronic device is to use the Bluetoothheadset as the voice pickup device and the voice play device in theprocess of the call to be made to the another user, the user may adjust,based on a requirement, the voice pickup device and the voice playdevice that are to be used by the electronic device in the process ofthe call to be made to the another user. As shown in FIG. 6F and FIG.6G, in response to an operation detected on the text of the wiredheadset that is in the list 604 shown in FIG. 6F, the electronic deviceadjusts, from the Bluetooth headset to the wired headset, the voicepickup device and the voice play device that are to be used in theprocess of the call to be made to the another user.

Refer to FIG. 6G. In response to an operation (for example, a touchoperation) detected on the control 604A, the electronic device initiatesa call request to another electronic device corresponding to a phonenumber shown in the user interface 31. Refer to FIG. 6H. After theanother electronic device corresponding to the phone number shown in theuser interface 31 accepts the call request, the electronic deviceselects a connected wired headset as a voice pickup device and a voiceplay device in a current call process.

It may be understood that, in addition to the scenario in which beforethe electronic device initiates the call request to the anotherelectronic device, the user adjusts or switches the voice pickup deviceand the voice play device that are to be used by the electronic devicein the call process and that is shown in FIG. 6E to FIG. 6H, after theelectronic device receives a call request initiated by the anotherelectronic device, the user may further adjust or switch a voice pickupdevice and a voice play device that are to be used by the electronicdevice in a call process. For example, after receiving the call requestinitiated by the another electronic device, the electronic device maydisplay, on the display, the list 604 shown in FIG. 6F. After the userselects an audio device from the list, the electronic device accepts thecall request, and uses the audio device selected by the user as thevoice pickup device and the voice play device in the call process.

After the call process shown in FIG. 6E to FIG. 6H ends, in a next callprocess, if the user does not actively select an audio device as a voicepickup device and a voice play device, the electronic device selects, asthe voice pickup device and the voice play device, an audio device (thatis, the wired headset) used after the user performs last switching.

According to Policy (4), the user may use an audio device used after theuser performs switching to make a call to a peer user. This meets a userexpectation, to improve user experience.

(5) When a plurality of cases occur simultaneously, the electronicdevice may select, in a time sequence, an audio device as the voicepickup device and the voice play device.

The plurality of cases include any two or more of the following: Theelectronic device is connected to an external audio device, the user hasactively selected an audio device as the voice pickup device and thevoice play device, and the user has switched an audio device in a callprocess and uses, as the voice pickup device and the voice play device,an audio device used after the switching.

For example, it is assumed that the electronic device is connected to anexternal audio device 1 at a first time point, the user actively selectsan audio device 2 as the voice pickup device and the voice play deviceat a second time point, and the user switches the voice pickup deviceand the voice play device to an audio device 3 at a third time point,where the audio device 1, the audio device 2, and the audio device 3 aredefault audio devices. In this case, when the user does not activelyselect an audio device as the voice pickup device and the voice playdevice, after establishing a call connection to another electronicdevice at a fourth time point, the electronic device selects the voicepickup device and the voice play device at a time point closest to thefourth time point. If the first time point is closest to the fourth timepoint, the electronic device selects the audio device 1 as the voicepickup device and the voice play device. If the second time point isclosest to the fourth time point, the electronic device selects theaudio device 2 as the voice pickup device and the voice play device. Ifthe third time point is closest to the fourth time point, the electronicdevice selects the audio device 3 as the voice pickup device and thevoice play device.

When the user does not actively select the audio device as the voicepickup device and the voice play device, after the electronic deviceselects the audio device as the voice pickup device and the voice playdevice by using any one of Policies (1) to (5), the electronic devicemay make a call to the another electronic device based on theestablished call connection. In addition, the audio device selected bythe electronic device meets a user expectation, so that user experiencecan be improved.

In the foregoing embodiments, that the electronic device ends the callprocess means that the electronic device actively breaks the callconnection on which the call process is based, or the another electronicdevice that makes a call to the electronic device breaks the callconnection. The electronic device may actively break the call connectionin any one of the following cases: receiving an operation (for example,a touch operation or a tap operation) performed on a hang-up controldisplayed on a display, receiving a double-tap operation performed on avolume button, or receiving an operation (for example, a touch operationor a tap operation) performed on a hang-up button on an external voicepickup device/voice play device.

In some embodiments of this application, in a call process between theelectronic device and the another electronic device, a currently usedvoice pickup device and voice play device may be disconnected from theelectronic device. Specifically, when the voice pickup device and thevoice play device that are used by the electronic device are an externalaudio device connected to the electronic device, the external audiodevice may be disconnected from the electronic device. For example, awired connection between the external audio device and the electronicdevice is broken, or a wireless connection between the external audiodevice and the electronic device is broken. After the currently usedvoice pickup device and voice play device are disconnected from theelectronic device, the electronic device selects a new voice pickupdevice and voice play device again from currently available audiodevices according to any one of Policies (1) to (5). This can ensurethat the call process is not interrupted, and the newly selected voicepickup device and voice play device meet a user expectation.

In some embodiments of this application, in a call process between theelectronic device and the another electronic device, a new externalaudio device may be connected to the electronic device in a wired orwireless manner. After the new external audio device is connected to theelectronic device, if the new external audio device is a default audiodevice, the electronic device switches the new external audio device toa currently used voice pickup device and voice play device; or if thenew external audio device is not a default audio device, the electronicdevice keeps a currently used voice pickup device and voice play deviceunchanged.

In some embodiments of this application, in a call process between theelectronic device and the another electronic device, the user may switchan audio device to a new audio device and use the new audio device as avoice pickup device and a voice play device, that is, the user maychange or adjust a currently used voice pickup device and voice playdevice. Herein, for a specific operation that the user switches theaudio device to the new audio device and uses the new audio device asthe voice pickup device and the voice play device, refer to relateddescriptions in Policy (4).

In this embodiment of this application, after the electronic deviceselects the audio device as the voice play device, if the audio devicehas been used as the voice play device, a volume at which the audiodevice plays peer audio is the same as a volume at which the audiodevice that is last used as the voice play device plays peer audio.Specifically, the electronic device records a volume at which each audiodevice that is used as a voice play device plays peer audio. The volumemay be a volume that is set or adjusted by the user, to determine avolume at which the audio device that is used as the voice play devicenext time plays peer audio. In this way, a user habit can be retained,and user experience can be improved.

In this embodiment of this application, after the electronic deviceselects the audio device as the voice play device, if the audio deviceis used as the voice play device for the first time, a volume at whichthe audio device plays peer audio may be a default value. Specifically,the electronic device may store a default voice play volume for eachtype of audio device, or may store a same default voice play volume forall audio devices. This is not limited in this embodiment of thisapplication.

In some embodiments of this application, regardless of whether the useractively selects the audio device as the voice pickup device and thevoice play device, the electronic device may select, from a stack, anaudio device as the voice pickup device and the voice pickup device inthe call process. Specifically, the electronic device may store a stackincluding audio devices available to the electronic device, where theaudio devices in the stack are sorted based on priorities. Theelectronic device maintains or updates the stack based on a runningstatus of the electronic device. After the electronic device establishesa call connection to the another electronic device and in a call processbetween the electronic device and the another electronic device, theelectronic device selects, from the stored stack, an audio device with ahighest priority as the voice pickup device and the voice play device.The electronic device may maintain or update the stack by using thefollowing several policies.

(1) When no external audio device is connected, the electronic deviceadjusts a priority of an audio device configured on the electronicdevice in the stack to the highest. A priority of a default audio deviceis higher than a priority of a non-default audio device, that is, apriority of an earpiece (receiver) is higher than a priority of aspeaker (speaker).

FIG. 7A shows a stack obtained after an electronic device updates astack by using Policy (1). In descending order of priorities, the stackshown in FIG. 7A sequentially includes an earpiece (receiver) and aspeaker (speaker).

After the electronic device updates the stack by using Policy (1), thatis, when the electronic device stores the stack shown in FIG. 7A, afterestablishing a call connection to another electronic device, theelectronic device selects the earpiece (receiver) with a highestpriority in the stack as a voice play device in a call process, andselects a microphone as a voice pickup device in the call process. Thisis the same as Policy (1) used by the electronic device to select thevoice pickup device and the voice play device in the foregoingembodiments. For details, refer to related descriptions in the foregoingembodiments.

(2) When the electronic device is newly connected to an external audiodevice, the electronic device adds the newly connected external audiodevice to the stack. If the external audio device to which theelectronic device is newly connected is a default audio device, theelectronic device adjusts a priority of the newly connected externalaudio device in the stack to the highest, and other audio devices in thestack are in descending order of priorities. If the external audiodevice to which the electronic device is newly connected is not adefault audio device, a priority of the newly connected external audiodevice in the stack is lower than priorities of all default audiodevices in the stack.

FIG. 7B is a possible schematic diagram in which an electronic deviceadjusts a priority of each audio device in a stack by using Policy (2).

In descending order of priorities, the first stack shown in FIG. 7Bsequentially includes an earpiece (receiver) and a speaker (speaker).With reference to the second stack shown in FIG. 7B, an external audiodevice newly accessed by the electronic device for the first time is awired headset, and the electronic device adds the wired headset to thestack. Because the wired headset is a default audio device, the wiredheadset has a highest priority in the stack.

With reference to the third stack and the fourth stack shown in FIG. 7B,an external audio device newly accessed by the electronic device for thesecond time is a smart band, and the electronic device adds the smartband to the stack. Because the smart band is not a default audio device,a priority of the smart band in the stack is lower than priorities ofall default audio devices (for example, a wired headset and an earpiece)in the stack. In some embodiments, with reference to the third stack,audio devices that are not default audio device have a same priority inthe stack. For example, the speaker (speaker) and the smart band have alowest and same priority in the stack. In some other embodiments, withreference to the fourth stack, priorities of audio devices that are notdefault audio devices in the stack are arranged in a time sequence inwhich the audio devices are connected to the electronic device, and alater time point indicates a highest priority. For example, a priorityof the smart band is higher than a priority of the speaker (speaker).

After the electronic device updates the stack by using Policy (2), afterestablishing a call connection to another electronic device, theelectronic device selects an audio device with a highest priority in thestack as the voice play device in the call process. This is the same asPolicy (2) used by the electronic device to select the voice pickupdevice and the voice play device in the foregoing embodiments. Fordetails, refer to related descriptions in the foregoing embodiments.

(3) When the electronic device is disconnected from an external audiodevice, the electronic device deletes the external audio device from thestack, and priorities of other audio devices in the stack remainunchanged.

FIG. 7C is a possible schematic diagram in which an electronic deviceadjusts a priority of each audio device in a stack by using Policy (3).In descending order of priorities, the first stack shown in FIG. 7Csequentially includes a wired headset, an earpiece (receiver), and aspeaker (speaker). After the wired headset is disconnected from theelectronic device, the electronic device deletes the wired headset fromthe stack, and a priority relationship between the earpiece (receiver)and the speaker (speaker) remains unchanged.

(4) When the user actively selects an audio device as a voice pickupdevice and a voice play device, the electronic device immediatelyadjusts a priority of the audio device actively selected by the user inthe stack to the highest, and other audio devices in the stack are indescending order of priorities. For a manner in which the user activelyselects the audio device as the voice pickup device and the voice playdevice, refer to related descriptions in the foregoing embodiments.

Specifically, if the audio device actively selected by the user is adefault audio device, the adjustment operation takes effectcontinuously. If the audio device actively selected by the user is not adefault audio device, the adjustment operation takes effect only in acurrent call process. After the current call ends, the electronic deviceadjusts the priority of the audio device actively selected by the userin the stack to a priority after priorities of all default audiodevices. This can avoid disclosing user privacy in a next call process,and reduce impact on other surrounding users.

FIG. 7D is a possible schematic diagram in which an electronic deviceadjusts a priority of each audio device in a stack by using Policy (4).

In descending order of priorities, the first stack shown in FIG. 7Dsequentially includes an earpiece (receiver), a wired headset, a speaker(speaker), and a smart band.

As shown in the first branch in FIG. 7D, when the electronic devicereceives a call request, if the user taps an answer button of the wiredheadset, the electronic device adjusts a priority of the wired headsetin the stack to the highest. Because the wired headset is a defaultaudio device, after a current call ends, the adjustment operation takeseffect continuously, that is, the wired headset still has a highestpriority in the stack.

As shown in the second branch in FIG. 7D, when the electronic devicereceives a call request, if the user taps an answer button of the smartband, the electronic device adjusts a priority of the smart band in thestack to the highest. Because the smart band is not a default audiodevice, the adjustment operation takes effect only in a current callprocess. After the current call ends, the priority of the smart bandfalls back to a priority after priorities of all default audio devices(for example, the earpiece (receiver) and the wired headset). Thepriority of the smart band may be higher than a priority of anothernon-default audio device (for example, the speaker (speaker)) in thestack, or may be the same as a priority of another non-default audiodevice (for example, the speaker (speaker)) in the stack.

After the electronic device updates the stack by using Policy (4), afterestablishing a call connection to another electronic device, theelectronic device selects an audio device with a highest priority in thestack as the voice play device in the call process. This is the same asPolicy (3) used by the electronic device to select the voice pickupdevice and the voice play device in the foregoing embodiments. Fordetails, refer to related descriptions in the foregoing embodiments.

(5) When the user switches an audio device and uses, as a voice pickupdevice and a voice play device, an audio device used after theswitching, the electronic device immediately adjusts a priority of theaudio device used after the switching in the stack to the highest, andother audio devices in the stack are in descending order of priorities.Herein, for a manner in which the user switches the voice pickup deviceand the voice play device, refer to related descriptions in theforegoing embodiments. Details are not described herein again.

Specifically, if the audio device used after the user performs theswitching is a default audio device, the adjustment operation takeseffect continuously. If the audio device used after the user performsthe switching is not a default audio device, the adjustment operationtakes effect only in a current call process. After the current callends, the electronic device adjusts the priority of the audio deviceused after the user performs the switching in the stack to a priorityafter priorities of all default audio devices. This can avoid disclosinguser privacy in a next call process, and reduce impact on othersurrounding users.

For example, FIG. 7E is a possible schematic diagram in which anelectronic device adjusts a priority of each audio device in a stack byusing Policy (5).

In descending order of priorities, the first stack shown in FIG. 7Esequentially includes a wired headset, an earpiece (receiver), a speaker(speaker), and a smart band.

As shown in the first branch in FIG. 7E, in a call process, if a userswitches the earpiece (receiver) to a voice play device, the electronicdevice adjusts a priority of the earpiece (receiver) in the stack to thehighest, and uses the earpiece (receiver) as the voice play device inthe call process. Because the earpiece (receiver) is a default audiodevice, after a current call ends, the adjustment operation takes effectcontinuously, that is, the earpiece (receiver) still has a highestpriority in the stack.

As shown in the second branch in FIG. 7E, in a call process, if the userswitches the speaker (speaker) to a voice play device, the electronicdevice adjusts a priority of the speaker (speaker) in the stack to thehighest, and uses the speaker (speaker) as the voice play device in thecall process. Because the speaker (speaker) is not a default audiodevice, the adjustment operation takes effect only in a current callprocess. After the current call ends, the priority of the speaker(speaker) falls back to a priority after priorities of all default audiodevices (for example, the earpiece (receiver) and the wired headset).The priority of the speaker (speaker) may be higher than a priority ofanother non-default audio device (for example, the smart band) in thestack, or may be the same as a priority of another non-default audiodevice (for example, the smart band) in the stack.

After the electronic device updates the stack by using Policy (5), afterestablishing a call connection to another electronic device, theelectronic device selects an audio device with a highest priority in thestack as the voice play device in the call process. This is the same asPolicy (4) used by the electronic device to select the voice pickupdevice and the voice play device in the foregoing embodiments. Fordetails, refer to related descriptions in the foregoing embodiments.

In a stack manner, after the electronic device establishes a callconnection to the another electronic device and in a call processbetween the electronic device and the another electronic device, theelectronic device may select, from the stack, an audio device with ahighest priority as the voice pickup device and the voice play device.This is convenient and facilitates management.

It may be understood that the stack mentioned above is merely a possibledata form. In some other embodiments, the electronic device may furtherstore a list of audio devices available to the electronic device or datain another form. The electronic device may update the list or the datain another form according to the foregoing policy, and after theelectronic device establishes a call connection to the anotherelectronic device and in a call process between the electronic deviceand the another electronic device, the electronic device selects, fromthe list or the data in another form, an audio device with a highestpriority as the voice pickup device and voice play device.

The foregoing embodiment describes, in detail with reference to theschematic diagram of human-computer interaction provided by theelectronic device, the call method provided in this application. Thefollowing describes the call method with reference to a method flowchartprovided in an embodiment of this application.

FIG. 8 is a schematic flowchart of a call method according to anembodiment of this application. In the call method shown in FIG. 8, whena user does not actively select an audio device as a voice pickup deviceand a voice play device, an electronic device selects the voice pickupdevice and the voice play device by using Policy (3). For details, referto related descriptions in the foregoing embodiments.

Refer to FIG. 8. The call method includes the following steps.

Step S110: Connect a first electronic device to a first external audiodevice.

The first external audio device is an audio device externally connectedto the first electronic device. The first electronic device may beconnected to the first external audio device in a wired or wirelessmanner. A type of the first external audio device is not limited in thisembodiment of this application. For a possible type of the first audiodevice, refer to related descriptions in the foregoing embodiments.

Step S120: In response to a first operation received on the firstexternal audio device, perform a first call process between the firstelectronic device and a second electronic device by using the firstexternal audio device, where the first external audio device isconfigured to: in the first call process, collect audio around the firstelectronic device, and play audio around the second electronic device.

In some embodiments, when the first electronic device serves as an endthat initiates a call request to the second electronic device, the usermay enter the first operation on the first external audio device towhich the electronic device is connected, to initiate the call requestto the second electronic device, and select the first external audiodevice as a voice pickup device and a voice play device in the callprocess between the first electronic device and the second electronicdevice. Herein, the first operation may include an operation (forexample, a double-tap operation or a touch and hold operation) performedon a dial button of the first external audio device, or a gesture or avoice instruction that is entered on the first external audio device andthat is used to trigger the electronic device to initiate a callrequest.

In some embodiments, when the first electronic device serves as an endthat receives a call request initiated by the second electronic device,the user may enter the first operation on the first external audiodevice to which the electronic device is connected, to accept the callrequest initiated by the second electronic device, and select the firstexternal audio device as a voice pickup device and a voice play devicein the call process between the first electronic device and the secondelectronic device. Herein, the first operation may include an operation(for example, a tap operation or a touch operation) performed on ananswer button of the first external audio device, or a gesture or avoice instruction that is entered on the first external audio device andthat is used to trigger the first electronic device to accept a callrequest.

The call process between the first electronic device and the secondelectronic device may include: The first electronic device collectsaudio around the first electronic device, and sends the audio around thefirst electronic device to the second electronic device. The firstelectronic device receives audio around the second electronic devicethat is sent by the second electronic device, and plays the audio aroundthe second electronic device. For ease of description, the call processbetween the first electronic device and the second electronic device maybe referred to as the first call process.

Herein, for step S120, refer to FIG. 2A and FIG. 2B, and relateddescriptions that the user actively selects the audio device as thevoice pickup device and the voice play device in the call process in theforegoing embodiments.

Step S130: The first electronic device ends the first call process.

That the first electronic device ends the first call process means thatthe first electronic device actively breaks a call connection on whichthe first call process is based, or the second electronic device choosesto end the first call process and break the call connection. For amanner in which the first electronic device actively breaks the callconnection, refer to related descriptions in the foregoing embodiments.

Step S140: Detect a second operation entered on the first electronicdevice, where the second operation is used to receive a call requestinitiated by a third electronic device, or the second operation is usedto initiate a call request to the third electronic device.

In some embodiments, when the first electronic device serves as an endthat initiates the call request to the third electronic device, the usermay enter the second operation on the first electronic device, toinitiate the call request to the third electronic device. Herein, thesecond operation may include an operation (for example, a tap operationor a touch operation) entered on a display screen of the electronicdevice, an input voice instruction or gesture used to initiate a callrequest, or the like. The operation entered on the display of theelectronic device may include the operation entered on the dial control301 in the user interface shown in FIG. 3. Herein, the user interfaceshown in FIG. 3 may be referred to as a third user interface.

In some embodiments, when the first electronic device serves as an endthat receives the call request initiated by the third electronic device,the user may enter the second operation on the first electronic device,to accept the call request initiated by the third electronic device.Herein, the second operation may include an operation entered on adisplay of the electronic device, an input voice instruction or gestureused to accept a call request, or the like. The operation entered on thedisplay of the electronic device may include a slide operation enteredon the answer control in the user interface 41 shown in FIG. 4a , or atap operation, a touch operation, or the like entered on the answercontrol in the user interface 42 shown in FIG. 4b . Herein, the userinterface shown in FIG. 4a or FIG. 4b may be referred to as a seconduser interface.

Herein, for a case in which the user enters the second operation on thefirst electronic device, that is, a case in which the user does notactively select the audio device as the voice pickup device and thevoice play device, refer to related descriptions in the embodiments inFIG. 3 and FIG. 4a and FIG. 4 b.

Step S150: In response to the second operation, if the first externalaudio device is a default audio device, perform a second call processbetween the first electronic device and the third electronic device byusing the first external audio device, where the first external audiodevice is configured to: in the second call process, collect audioaround the first electronic device, and play audio around the thirdelectronic device.

After ending the first call process, as an end that initiates a callrequest or an end that receives a call request, the first electronicdevice may perform the call process between the first electronic deviceand the third electronic device in response to the second operationentered by the user on the first electronic device.

If the first external audio device is the default audio device, thefirst electronic device selects, in response to the second operation,the first external audio device as the voice pickup device and the voiceplay device in the call process between the first electronic device andthe third electronic device.

If the first external audio device is not the default audio device, thefirst electronic device selects, in response to the second operation, acurrent audio device with a highest priority from the foregoing stack asthe voice pickup device and the voice play device in the call processbetween the first electronic device and the third electronic device.

The call process between the first electronic device and the thirdelectronic device may include: The first electronic device collectsaudio around the first electronic device, and sends the audio around thefirst electronic device to the third electronic device. The firstelectronic device receives audio around the third electronic device thatis sent by the third electronic device, and plays the audio around thethird electronic device. For ease of description, the call processbetween the first electronic device and the third electronic device maybe referred to as the second call process.

FIG. 9 is a schematic flowchart of another call method according to anembodiment of this application. In the call method shown in FIG. 9, whena user does not actively select an audio device as a voice pickup deviceand a voice play device, an electronic device selects the voice pickupdevice and the voice play device in Manner (1) in Policy (4). Fordetails, refer to the embodiments in FIG. 6A to FIG. 6D and relateddescriptions.

Refer to FIG. 9. The call method includes the following steps.

Step S210: A first electronic device performs a third call processbetween the first electronic device and a fourth electronic device byusing a first audio device, where the first audio device is configuredto: in the third call process, collect audio around the first electronicdevice, and play audio around the fourth electronic device.

The first audio device may be an audio device configured on the firstelectronic device, or may be an external audio device to which the firstaudio device is connected. When the first audio device is the audiodevice configured on the first electronic device, the first audio devicemay include a plurality of audio devices. For example, the first audiodevice may include a microphone and an earpiece (receiver), or the firstaudio device may include a microphone and a speaker (speaker).

The call process between the first electronic device and the thirdelectronic device may include: The first electronic device collectsaudio around the first electronic device, and sends the audio around thefirst electronic device to the fourth electronic device. The firstelectronic device receives audio around the fourth electronic devicethat is sent by the fourth electronic device, and plays the audio aroundthe fourth electronic device. For ease of description, the call processbetween the first electronic device and the fourth electronic device maybe referred to as the third call process.

Step S220: Detect a third operation used to switch to a second audiodevice.

For a manner in which the first electronic device switches an audiodevice in the third call process, refer to related descriptions in theforegoing embodiments in FIG. 6A to FIG. 6C. The user interface shown inFIG. 6A may be referred to as a first user interface, the icon 601 orthe control 602 may be referred to as a control used to switch an audiodevice, and the icon and/or the text in the list 603 may be referred toas an option of an audio device. The third operation may include anoperation (for example, a tap operation) performed on an option that isof a third audio device and that is in the list 603.

The second audio device is similar to the first audio device, and may bean audio device configured on the first electronic device, or may be anexternal audio device to which the first audio device is connected.Alternatively, the second audio device is different from the first audiodevice.

Step S230: In response to the third operation, continue performing thethird call process by using the second audio device, where the secondaudio device is configured to: in the third call process, continuecollecting audio around the first electronic device, and continueplaying audio around the fourth electronic device.

After the user switches to the second audio device, the first electronicdevice immediately continues performing the third call process by usingthe second audio device.

Step S240: End the third call process.

A manner in which the first electronic device ends the third callprocess is similar to step S130 in the method shown in FIG. 8. Fordetails, refer to related descriptions.

Step S250: Detect a second operation entered on the first electronicdevice, where the second operation is used to receive a call requestinitiated by a third electronic device, or the second operation is usedto initiate a call request to the third electronic device.

Step S250 is the same as step S140 in the method shown in FIG. 8. Fordetails, refer to related descriptions.

Step S260: In response to the second operation, if the second audiodevice is a default audio device, perform a second call process betweenthe first electronic device and the third electronic device by using thesecond audio device, where the second audio device is configured to: inthe second call process, collect audio around the first electronicdevice, and play audio around the third electronic device.

After ending the third call process, as an end that initiates a callrequest or an end that receives a call request, the first electronicdevice may perform the call process between the first electronic deviceand the third electronic device in response to the second operationentered by the user on the first electronic device.

If the second audio device is the default audio device, the firstelectronic device selects, in response to the second operation, thesecond audio device as the voice pickup device and the voice play devicein the call process between the first electronic device and the thirdelectronic device.

If the second audio device is not the default audio device, the firstelectronic device selects, in response to the second operation, acurrent audio device with a highest priority from the foregoing stack asthe voice pickup device and the voice play device in the call processbetween the first electronic device and the third electronic device.

For the call process between the first electronic device and the thirdelectronic device, refer to related descriptions in the method shown inFIG. 8.

In some embodiments, when the user does not actively select the audiodevice as the voice pickup device and the voice play device, the firstelectronic device may further select the voice pickup device and thevoice play device by using Policy (2). Specifically, in the call methodsshown in FIG. 8 and FIG. 9, the first electronic device performs thesecond call process between the first electronic device and the thirdelectronic device, and after ending the second call process, the firstelectronic device may be further connected to a second external audiodevice. When the first electronic device detects a fourth operationentered on the first electronic device, in response to the fourthoperation, if the second external audio device is a default audiodevice, the first electronic device performs a fourth call processbetween the first electronic device and a fifth electronic device byusing the second external audio device; or if the second external audiodevice is not a default audio device, the first electronic deviceselects a current audio device with a highest priority from theforegoing stack as the voice pickup device and the voice play device inthe call process between the first electronic device and the fifthelectronic device. The fourth operation is used to receive a callrequest initiated by the fifth electronic device, or the fourthoperation is used to initiate a call request to the fifth electronicdevice.

The first electronic device may be connected to the second externalaudio device in a wired or wireless manner. The second external audiodevice is similar to the first external audio device. For details, referto related descriptions. Alternatively, the second external audio deviceis different from the first external audio device. The fourth operationis similar to the second operation, and the fourth call process issimilar to the first call process. For details, refer to relateddescriptions.

In some embodiments, when the user does not actively select the audiodevice as the voice pickup device and the voice play device, the firstelectronic device may further select the voice pickup device and thevoice play device in Manner (2) in Policy (4). For details, refer torelated descriptions in the embodiments in FIG. 6E to FIG. 6H.Specifically, in the call methods shown in FIG. 8 and FIG. 9, afterperforming the second call process between the first electronic deviceand the third electronic device, the first electronic device may furtherperform the following steps: ending the second call process; detecting afifth operation, where the fifth operation is used to receive a callrequest initiated by a sixth electronic device, or the fifth operationis used to initiate a call request to the sixth electronic device;displaying one or more audio device options and an OK control inresponse to the fifth operation, where the one or more audio deviceoptions include an option of an audio device configured on the firstelectronic device and an option of an external audio device to which thefirst electronic device is connected, and the one or more audio deviceoptions include an option of a third audio device; after detecting anoperation of selecting the option of the third audio device, detecting asixth operation performed on the OK control, and in response to thesixth operation, performing a fifth call process by using the thirdaudio device; ending the fifth call process; detecting a seventhoperation entered on the first electronic device, where the seventhoperation is used to receive a call request initiated by a seventhelectronic device, or the seventh operation is used to initiate a callrequest to the seventh electronic device; and in response to the seventhoperation, if the third audio device is a default audio device,performing a sixth call process between the first electronic device andthe seventh electronic device by using the third audio device; or if thesecond external audio device is not a default audio device, selecting,by the first electronic device, a current audio device with a highestpriority from the foregoing stack as the voice pickup device and thevoice play device in the call process between the first electronicdevice and the seventh electronic device.

The fifth operation is similar to the second operation, and the fifthcall process is similar to the first call process. For details, refer torelated descriptions.

For the one or more audio device options and the OK control displayed inresponse to the fifth operation, refer to each audio device option andthe OK control 604A in the user interface shown in FIG. 6G. The sixthoperation may be specifically a tap operation, a touch operation, or thelike performed on the OK control 604.

The seventh operation is similar to the second operation, and the sixthcall process is similar to the first call process. For details, refer torelated descriptions.

It may be understood that the second electronic device, the thirdelectronic device, the fourth electronic device, the fifth electronicdevice, the sixth electronic device, and the seventh electronic devicementioned above may be the same or different. This is not limited inthis application.

There may be one or more second electronic devices, third electronicdevices, fourth electronic devices, fifth electronic devices, sixthelectronic devices, and seventh electronic devices mentioned above. Thisis not limited in this application.

For the default audio device mentioned in the foregoing call methodsshown in FIG. 8 and FIG. 9, refer to related descriptions about thedefault audio device in the foregoing human-computer interactionembodiments. Details are not described herein again.

In some embodiments, the first electronic device stores one or morepriorities of one or more audio devices, the one or more audio devicesinclude an audio device configured on the electronic device and anexternal audio device to which the electronic device is connected, andan audio device with a highest priority is configured to perform a callprocess between the first electronic device and another electronicdevice. For a manner in which the first electronic device stores andupdates a priority of each audio device, refer to related descriptionsabout the stack in the embodiments in FIG. 7A to FIG. 7E.

An embodiment of this application provides a corresponding apparatus, toperform the call method provided in the foregoing embodiment. Thefollowing describes an electronic device provided in embodiments of thisapplication.

FIG. 10A is a schematic diagram of a structure of an electronic device100 according to an embodiment of this application.

FIG. 10A is a schematic diagram of a structure of an electronic device100.

The electronic device 100 may include a processor 110, an externalmemory interface 120, an internal memory 121, a universal serial bus(universal serial bus, USB) port 130, a charging management module 140,a power management module 141, a battery 142, an antenna 1, an antenna2, a mobile communications module 150, a wireless communications module160, an audio module 170, a speaker 170A, a receiver 170B, a microphone170C, a headset jack 170D, a sensor module 180, a button 190, a motor191, an indicator 192, a camera 193, a display 194, a subscriberidentification module (subscriber identification module, SIM) cardinterface 195, and the like. The sensor module 180 may include apressure sensor 180A, a gyro sensor 180B, a barometric pressure sensor180C, a magnetic sensor 180D, an acceleration sensor 180E, a distancesensor 180F, an optical proximity sensor 180G, a fingerprint sensor180H, a temperature sensor 180J, a touch sensor 180K, an ambient lightsensor 180L, a bone conduction sensor 180M, and the like.

It may be understood that the structure shown in this embodiment of thisapplication does not constitute a specific limitation on the electronicdevice 100. In some other embodiments of this application, theelectronic device 100 may include more or fewer components than thoseshown in the figure, or may combine some components, or may split somecomponents, or may have different component arrangements. The componentsshown in the figure may be implemented by using hardware, software, or acombination of software and hardware.

The processor 110 may include one or more processing units. For example,the processor 110 may include an application processor (applicationprocessor, AP), a modem processor, a graphics processing unit (graphicsprocessing unit, GPU), an image signal processor (image signalprocessor, ISP), a controller, a video codec, a digital signal processor(digital signal processor, DSP), a baseband processor, and/or aneural-network processing unit (neural-network processing unit, NPU).Different processing units may be independent components, or may beintegrated into one or more processors.

The controller may generate an operation control signal based on aninstruction operation code and a time sequence signal, to controlinstruction reading and instruction execution.

A memory may be further disposed in the processor 110, and is configuredto store instructions and data. In some embodiments, the memory in theprocessor 110 is a cache memory. The memory may store instructions ordata just used or cyclically used by the processor 110. If the processor110 needs to use the instructions or the data again, the processor 110may directly invoke the instructions or the data from the memory. Thisavoids repeated access and reduces a waiting time of the processor 110,so that system efficiency is improved.

In some embodiments, the processor 110 may include one or moreinterfaces. The interface may include an inter-integrated circuit(inter-integrated circuit, I2C) interface, an inter-integrated circuitsound (inter-integrated circuit sound, I2S) interface, a pulse codemodulation (pulse code modulation, PCM) interface, a universalasynchronous receiver/transmitter (universal asynchronousreceiver/transmitter, UART) interface, a mobile industry processorinterface (mobile industry processor interface, MIPI), a general-purposeinput/output (general-purpose input/output, GPIO) interface, asubscriber identification module (subscriber identity module, SIM)interface, a universal serial bus (universal serial bus, USB) interface,and/or the like.

The I2C interface is a two-way synchronization serial bus, and includesa serial data line (serial data line, SDA) and a serial clock line(derail clock line, SCL). In some embodiments, the processor 110 mayinclude a plurality of groups of I2C buses. The processor 110 may beseparately coupled to the touch sensor 180K, a charger, a flashlight,the camera 193, and the like through different I2C bus interfaces. Forexample, the processor 110 may be coupled to the touch sensor 180Kthrough an I2C interface, so that the processor 110 communicates withthe touch sensor 180K through the I2C bus interface, to implement atouch function of the electronic device 100.

The I2S interface may be configured to perform audio communication. Insome embodiments, the processor 110 may include a plurality of groups ofI2S buses. The processor 110 may be coupled to the audio module 170through the I2S bus, to implement communication between the processor110 and the audio module 170. In some embodiments, the audio module 170may transfer an audio signal to the wireless communications module 160through the I2S interface, to implement a function of answering a callby using a Bluetooth headset.

The PCM interface may also be configured to: perform audiocommunication, and sample, quantize, and code an analog signal. In someembodiments, the audio module 170 may be coupled to the wirelesscommunications module 160 through a PCM bus interface. In someembodiments, the audio module 170 may alternatively transfer an audiosignal to the wireless communications module 160 through the PCMinterface, to implement a function of answering a call by using aBluetooth headset. Both the I2S interface and the PCM interface may beconfigured to perform audio communication.

The UART interface is a universal serial data bus, and is configured toperform asynchronous communication. The bus may be a two-waycommunications bus. The bus converts to-be-transmitted data betweenserial communication and parallel communication. In some embodiments,the UART interface is usually configured to connect the processor 110 tothe wireless communications module 160. For example, the processor 110communicates with a Bluetooth module in the wireless communicationsmodule 160 through the UART interface, to implement a Bluetoothfunction. In some embodiments, the audio module 170 may transfer anaudio signal to the wireless communications module 160 through the UARTinterface, to implement a function of playing music by using a Bluetoothheadset.

The MIPI interface may be configured to connect the processor 110 to aperipheral component such as the display 194 or the camera 193. The MIPIinterface includes a camera serial interface (camera serial interface,CSI), a display serial interface (display serial interface, DSI), andthe like. In some embodiments, the processor 110 communicates with thecamera 193 through the CSI, to implement a photographing function of theelectronic device 100. The processor 110 communicates with the display194 through the DSI, to implement a display function of the electronicdevice 100.

The GPIO interface may be configured by using software. The GPIOinterface may be configured as a control signal or a data signal. Insome embodiments, the GPIO interface may be configured to connect theprocessor 110 to the camera 193, the display 194, the wirelesscommunications module 160, the audio module 170, the sensor module 180,or the like. The GPIO interface may alternatively be configured as anI2C interface, an I2S interface, a UART interface, an MIPI interface, orthe like.

The USB port 130 is a port that conforms to a USB standardspecification, and may be specifically a mini USB port, a micro USBport, a USB Type-C port, or the like. The USB port 130 may be configuredto connect to the charger to charge the electronic device 100, or may beconfigured to transmit data between the electronic device 100 and aperipheral device. The USB port 130 may alternatively be configured toconnect to a headset, to play audio by using the headset. Alternatively,the port may be configured to connect to another electronic device, forexample, an AR device.

It may be understood that an interface connection relationship betweenthe modules illustrated in this embodiment of this application is merelyused as an example for description, and does not constitute a limitationon the structure of the electronic device 100. In some other embodimentsof this application, the electronic device 100 may alternatively use aninterface connection manner different from that in the foregoingembodiment, or a combination of a plurality of interface connectionmanners.

The charging management module 140 is configured to receive a charginginput from the charger. The charger may be a wireless charger or a wiredcharger. In some embodiments of wired charging, the charging managementmodule 140 may receive a charging input from a wired charger through theUSB port 130. In some embodiments of wireless charging, the chargingmanagement module 140 may receive a wireless charging input through awireless charging coil of the electronic device 100. The chargingmanagement module 140 may further supply power to the electronic deviceby using the power management module 141 while charging the battery 142.

The power management module 141 is configured to connect the battery 142and the charging management module 140 to the processor 110. The powermanagement module 141 receives an input of the battery 142 and/or aninput of the charging management module 140, and supplies power to theprocessor 110, the internal memory 121, the display 194, the camera 193,the wireless communications module 160, and the like. The powermanagement module 141 may be further configured to monitor parameterssuch as a battery capacity, a battery cycle count, and a battery healthstatus (electric leakage or impedance). In some other embodiments, thepower management module 141 may alternatively be disposed in theprocessor 110. In some other embodiments, the power management module141 and the charging management module 140 may alternatively be disposedin a same device.

A wireless communication function of the electronic device 100 may beimplemented through the antenna 1, the antenna 2, the mobilecommunications module 150, the wireless communications module 160, themodem processor, the baseband processor, and the like.

The antenna 1 and the antenna 2 are configured to: transmit and receiveelectromagnetic wave signals. Each antenna in the electronic device 100may be configured to cover one or more communication bands. Differentantennas may be further multiplexed to improve antenna utilization. Forexample, the antenna 1 may be multiplexed as a diversity antenna in awireless local area network. In some other embodiments, an antenna maybe used in combination with a tuning switch.

The mobile communications module 150 may provide a wirelesscommunication solution that includes 2G/3G/4G/5G or the like and that isapplied to the electronic device 100. The mobile communications module150 may include at least one filter, a switch, a power amplifier, a lownoise amplifier (low noise amplifier, LNA), and the like. The mobilecommunications module 150 may receive an electromagnetic wave throughthe antenna 1, perform processing such as filtering and amplification onthe received electromagnetic wave, and transmit a processedelectromagnetic wave to the modem processor for demodulation. The mobilecommunications module 150 may further amplify a signal modulated by themodem processor, and convert the signal into an electromagnetic wave forradiation through the antenna 1. In some embodiments, at least somefunctional modules of the mobile communications module 150 may bedisposed in the processor 110. In some embodiments, at least somefunctional modules of the mobile communications module 150 and at leastsome modules of the processor 110 may be disposed in a same device.

The modem processor may include a modulator and a demodulator. Themodulator is configured to modulate a to-be-sent low-frequency basebandsignal into a medium or high-frequency signal. The demodulator isconfigured to demodulate a received electromagnetic wave signal into alow-frequency baseband signal. Then, the demodulator transmits thelow-frequency baseband signal obtained through demodulation to thebaseband processor for processing. The low-frequency baseband signal isprocessed by the baseband processor, and then transmitted to theapplication processor. The application processor outputs a sound signalthrough an audio device (which is not limited to the speaker 170A, thereceiver 170B, or the like), or displays an image or a video through thedisplay 194. In some embodiments, the modem processor may be anindependent component. In some other embodiments, the modem processormay be independent of the processor 110, and is disposed in a samedevice as the mobile communications module 150 or another functionalmodule.

The wireless communications module 160 may provide a wirelesscommunication solution that includes a wireless local area network(wireless local area networks, WLAN) (for example, a wireless fidelity(wireless fidelity, Wi-Fi) network), Bluetooth (Bluetooth, BT), a globalnavigation satellite system (global navigation satellite system, GNSS),frequency modulation (frequency modulation, FM), near fieldcommunication (near field communication, NFC), an infrared (infrared,IR) technology, or the like and that is applied to the electronic device100. The wireless communications module 160 may be one or morecomponents integrating at least one communications processor module. Thewireless communications module 160 receives an electromagnetic wavethrough the antenna 2, performs frequency modulation and filteringprocessing on the electromagnetic wave signal, and sends a processedsignal to the processor 110. The wireless communications module 160 mayfurther receive a to-be-sent signal from the processor 110, performfrequency modulation and amplification on the signal, and convert aprocessed signal into an electromagnetic wave for radiation through theantenna 2.

In some embodiments, the antenna 1 and the mobile communications module150 in the electronic device 100 are coupled, and the antenna 2 and thewireless communications module 160 in the electronic device 100 arecoupled, so that the electronic device 100 can communicate with anetwork and another device by using a wireless communicationstechnology. The wireless communications technology may include a globalsystem for mobile communications (global system for mobilecommunications, GSM), a general packet radio service (general packetradio service, GPRS), code division multiple access (code divisionmultiple access, CDMA), wideband code division multiple access (widebandcode division multiple access, WCDMA), time-division code divisionmultiple access (time-division code division multiple access, TD-SCDMA),long term evolution (long term evolution, LTE), BT, a GNSS, a WLAN, NFC,FM, an IR technology, and/or the like. The GNSS may include a globalpositioning system (global positioning system, GPS), a global navigationsatellite system (global navigation satellite system, GLONASS), a BeiDounavigation satellite system (BeiDou navigation satellite system, BDS), aquasi-zenith satellite system (quasi-zenith satellite system, QZSS),and/or satellite based augmentation systems (satellite basedaugmentation systems, SBAS).

The electronic device 100 implements a display function by using theGPU, the display 194, the application processor, and the like. The GPUis a microprocessor for image processing, and is connected to thedisplay 194 and the application processor. The GPU is configured to:perform mathematical and geometric calculation, and render an image. Theprocessor 110 may include one or more GPUs that execute programinstructions to generate or change display information.

The display 194 is configured to display an image, a video, and thelike. The display 194 includes a display panel. The display panel may bea liquid crystal display (liquid crystal display, LCD), an organiclight-emitting diode (organic light-emitting diode, OLED), anactive-matrix organic light-emitting diode (active-matrix organiclight-emitting diode, AMOLED), a flexible light-emitting diode (flexlight-emitting diode, FLED), a mini LED, a micro LED, a micro OLED, aquantum dot light-emitting diode (quantum dot light-emitting diodes,QLED), or the like. In some embodiments, the electronic device 100 mayinclude one or N displays 194, where N is a positive integer greaterthan 1.

The electronic device 100 may implement a photographing function byusing the ISP, the camera 193, the video codec, the GPU, the display194, the application processor, and the like.

The ISP is configured to process data fed back by the camera 193. Forexample, during photographing, a shutter is pressed, light istransmitted to a photosensitive element of the camera through a lens, anoptical signal is converted into an electrical signal, and thephotosensitive element of the camera transmits the electrical signal tothe ISP for processing, to convert the electrical signal into a visibleimage. The ISP may further perform algorithm optimization on noise,brightness, and complexion of the image. The ISP may further optimizeparameters such as exposure and a color temperature of a photographingscenario. In some embodiments, the ISP may be disposed in the camera193.

The camera 193 is configured to capture a static image or a video. Anoptical image of an object is generated through the lens, and isprojected onto the photosensitive element. The photosensitive elementmay be a charge-coupled device (charge-coupled device, CCD) or acomplementary metal-oxide-semiconductor (complementarymetal-oxide-semiconductor, CMOS) phototransistor. The photosensitiveelement converts an optical signal into an electrical signal, and thentransmits the electrical signal to the ISP for converting the electricalsignal into a digital image signal. The ISP outputs the digital imagesignal to the DSP for processing. The DSP converts the digital imagesignal into an image signal in a standard format such as an RGB formator a YUV format. In some embodiments, the electronic device 100 mayinclude one or N cameras 193, where N is a positive integer greater than1.

The digital signal processor is configured to process a digital signal,and may process another digital signal in addition to the digital imagesignal. For example, when the electronic device 100 selects a frequency,the digital signal processor is configured to perform Fourier transformand the like on frequency energy.

The video codec is configured to: compress or decompress a digitalvideo. The electronic device 100 may support one or more video codecs.Therefore, the electronic device 100 may play or record videos in aplurality of coding formats, for example, moving picture experts group(moving picture experts group, MPEG)-1, MPEG-2, MPEG-3, and MPEG-4.

The NPU is a neural-network (neural-network, NN) computing processor.The NPU quickly processes input information by referring to a structureof a biological neural network, for example, a transfer mode betweenhuman brain neurons, and may further continuously perform self-learning.The NPU can implement applications such as intelligent cognition of theelectronic device 100, such as image recognition, facial recognition,speech recognition, and text understanding.

The external memory interface 120 may be configured to connect to anexternal storage card, for example, a micro SD card, to extend a storagecapability of the electronic device 100. The external storage cardcommunicates with the processor 110 through the external memoryinterface 120, to implement a data storage function. For example, filessuch as music and a video are stored in the external storage card.

The internal memory 121 may be configured to store computer-executableprogram code. The executable program code includes instructions. Theinternal memory 121 may include a program storage area and a datastorage area. The program storage area may store an operating system, anapplication required by at least one function (for example, a soundplaying function or an image playing function), and the like. The datastorage area may store data (such as audio data and a phone book) andthe like that are created during use of the electronic device 100. Inaddition, the internal memory 121 may include a high-speed random accessmemory, or may include a nonvolatile memory such as at least onemagnetic disk storage device, a flash memory, or a universal flashstorage (universal flash storage, UFS). The processor 110 runs theinstructions stored in the internal memory 121 and/or the instructionsstored in the memory disposed in the processor, to perform variousfunction applications and data processing of the electronic device 100.

The electronic device 100 may implement audio functions, for example,music playing and recording, by using the audio module 170, the speaker170A, the receiver 170B, the microphone 170C, the headset jack 170D, theapplication processor, and the like.

The audio module 170 is configured to convert digital audio informationinto an analog audio signal output, and is also configured to convert ananalog audio input into a digital audio signal. The audio module 170 maybe further configured to: code and decode an audio signal. In someembodiments, the audio module 170 may be disposed in the processor 110,or some functional modules of the audio module 170 are disposed in theprocessor 110.

The speaker 170A, also referred to as a “loudspeaker”, is configured toconvert an audio electrical signal into a sound signal. The electronicdevice 100 may be used to listen to music or answer a call in ahands-free mode over the speaker 170A.

The receiver 170B, also referred to as an “earpiece”, is configured toconvert an electrical audio signal into a sound signal. When a call isanswered or audio information is listened to by using the electronicdevice 100, the receiver 170B may be put close to a human ear to listento a voice.

The microphone 170C, also referred to as a “mike” or a “mic”, isconfigured to convert a sound signal into an electrical signal. Whenmaking a call or sending voice information, a user may make a sound bymoving a human mouth close to the microphone 170C to input a soundsignal to the microphone 170C. At least one microphone 170C may bedisposed in the electronic device 100. In some other embodiments, twomicrophones 170C may be disposed in the electronic device 100, tocollect a sound signal and implement a noise reduction function. In someother embodiments, three, four, or more microphones 170C mayalternatively be disposed in the electronic device 100, to collect asound signal, implement noise reduction, and identify a sound source, soas to implement a directional recording function and the like.

The headset jack 170D is configured to connect to a wired headset. Theheadset jack 170D may be the USB port 130, or may be a 3.5 mm openmobile terminal platform (open mobile terminal platform, OMTP) standardinterface or cellular telecommunications industry association of the USA(cellular telecommunications industry association of the USA, CTIA)standard interface.

The pressure sensor 180A is configured to sense a pressure signal, andcan convert the pressure signal into an electrical signal. In someembodiments, the pressure sensor 180A may be disposed on the display194. There are a plurality of types of pressure sensors 180A, such as aresistive pressure sensor, an inductive pressure sensor, and acapacitive pressure sensor. The capacitive pressure sensor may includeat least two parallel plates made of conductive materials. When a forceis applied to the pressure sensor 180A, capacitance between electrodeschanges. The electronic device 100 determines pressure intensity basedon a capacitance change. When a touch operation is performed on thedisplay 194, the electronic device 100 detects intensity of the touchoperation by using the pressure sensor 180A. The electronic device 100may also calculate a touch location based on a detection signal of thepressure sensor 180A. In some embodiments, touch operations that areperformed at a same touch location but have different touch operationintensity may correspond to different operation instructions. Forexample, when a touch operation whose touch operation intensity is lessthan a first pressure threshold is performed on a Messages icon, aninstruction for viewing an SMS message is executed. When a touchoperation whose touch operation intensity is greater than or equal tothe first pressure threshold is performed on a Messages icon, aninstruction for creating a new SMS message is executed.

The gyro sensor 180B may be configured to determine a motion posture ofthe electronic device 100. In some embodiments, an angular velocity ofthe electronic device 100 around three axes (that is, axes X, Y, and Z)may be determined by using the gyro sensor 180B. The gyro sensor 180Bmay be configured to perform image stabilization during photographing.For example, when a shutter is pressed, the gyro sensor 180B detects anangle at which the electronic device 100 jitters, calculates, based onthe angle, a distance for which a lens module needs to compensate, andallows the lens to cancel the jitter of the electronic device 100through reverse motion, to implement image stabilization. The gyrosensor 180B may be further used in a navigation scenario and amotion-sensing game scenario.

The barometric pressure sensor 180C is configured to measure barometricpressure. In some embodiments, the electronic device 100 calculates analtitude based on a value of the barometric pressure measured by thebarometric pressure sensor 180C, to assist in positioning andnavigation.

The magnetic sensor 180D includes a Hall sensor. The electronic device100 may detect opening and closing of a flip cover leather case by usingthe magnetic sensor 180D. In some embodiments, when the electronicdevice 100 is a clamshell phone, the electronic device 100 may detectopening and closing of a flip cover by using the magnetic sensor 180D.Further, a feature such as automatic unlocking upon opening of the flipcover is set based on a detected opening or closing state of the leathercase or a detected opening or closing state of the flip cover.

The acceleration sensor 180E may detect magnitudes of accelerations ofthe electronic device 100 in various directions (usually on three axes),and may detect a magnitude and a direction of gravity when theelectronic device 100 is still. The acceleration sensor 180E may befurther configured to identify a posture of the electronic device, andis used in an application such as switching between landscape mode andportrait mode or a pedometer.

The distance sensor 180F is configured to measure a distance. Theelectronic device 100 may measure the distance in an infrared manner ora laser manner. In some embodiments, in a photographing scenario, theelectronic device 100 may measure a distance by using the distancesensor 180F to implement quick focusing.

The optical proximity sensor 180G may include, for example, alight-emitting diode (LED) and an optical detector such as a photodiode.The light-emitting diode may be an infrared light-emitting diode. Theelectronic device 100 emits infrared light by using the light-emittingdiode. The electronic device 100 detects infrared reflected light from anearby object by using the photodiode. When sufficient reflected lightis detected, the electronic device 100 may determine that there is anobject near the electronic device 100. When insufficient reflected lightis detected, the electronic device 100 may determine that there is noobject near the electronic device 100. The electronic device 100 maydetect, by using the optical proximity sensor 180G, that a user holdsthe electronic device 100 close to an ear for a call, to automaticallyturn off a screen for power saving. The optical proximity sensor 180Gmay also be used in a leather case mode or a pocket mode toautomatically unlock or lock the screen.

The ambient light sensor 180L is configured to sense ambient lightbrightness. The electronic device 100 may adaptively adjust brightnessof the display 194 based on the sensed ambient light brightness. Theambient light sensor 180L may also be configured to automatically adjusta white balance during photographing. The ambient light sensor 180L mayfurther cooperate with the optical proximity sensor 180G to detectwhether the electronic device 100 is in a pocket, to prevent anaccidental touch.

The fingerprint sensor 180H is configured to collect a fingerprint. Theelectronic device 100 may use a feature of the collected fingerprint toimplement fingerprint-based unlocking, application lock access,fingerprint-based photographing, fingerprint-based call answering, andthe like.

The temperature sensor 180J is configured to detect a temperature. Insome embodiments, the electronic device 100 executes a temperatureprocessing policy based on the temperature detected by the temperaturesensor 180J. For example, when the temperature reported by thetemperature sensor 180J exceeds a threshold, the electronic device 100lowers performance of a processor located near the temperature sensor180J, to reduce power consumption to implement thermal protection. Insome other embodiments, when the temperature is less than anotherthreshold, the electronic device 100 heats the battery 142 to preventthe electronic device 100 from being shut down abnormally due to a lowtemperature. In some other embodiments, when the temperature is lessthan still another threshold, the electronic device 100 boosts an outputvoltage of the battery 142 to avoid abnormal shutdown due to a lowtemperature.

The touch sensor 180K is also referred to as a “touch panel”. The touchsensor 180K may be disposed on the display 194, and the touch sensor180K and the display 194 form a touchscreen. The touch sensor 180K isconfigured to detect a touch operation performed on or near the touchsensor 180K. The touch sensor may transfer the detected touch operationto the application processor to determine a type of a touch event. Avisual output related to the touch operation may be provided on thedisplay 194. In some other embodiments, the touch sensor 180K mayalternatively be disposed on a surface of the electronic device 100 at alocation different from that of the display 194.

The bone conduction sensor 180M may obtain a vibration signal. In someembodiments, the bone conduction sensor 180M may obtain a vibrationsignal of a vibration bone of a human vocal part. The bone conductionsensor 180M may also be in contact with a human pulse, to receive ablood pressure beating signal. In some embodiments, the bone conductionsensor 180M may alternatively be disposed in the headset, to obtain abone conduction headset. The audio module 170 may obtain a voice signalthrough parsing based on the vibration signal that is of the vibrationbone of the vocal part and that is obtained by the bone conductionsensor 180M, to implement a voice function. The application processormay parse heart rate information based on the blood pressure beatingsignal obtained by the bone conduction sensor 180M, to implement a heartrate detection function.

The button 190 includes a power button, a volume button, and the like.The button 190 may be a mechanical button, or may be a touch button. Theelectronic device 100 may receive a key input, and generate a key signalinput related to a user setting and function control of the electronicdevice 100.

The motor 191 may generate a vibration prompt. The motor 191 may beconfigured to provide an incoming call vibration prompt or a touchvibration feedback. For example, touch operations performed on differentapplications (for example, photographing and audio playing) maycorrespond to different vibration feedback effects. The motor 191 mayalso correspond to different vibration feedback effects for touchoperations performed on different areas of the display 194. Differentapplication scenarios (for example, a time reminder, informationreceiving, an alarm clock, a game) may also correspond to differentvibration feedback effects. A touch vibration feedback effect may befurther customized.

The indicator 192 may be an indicator light, and may be configured toindicate a charging status and a power change, or may be configured toindicate a message, a missed call, a notification, and the like.

The SIM card interface 195 is configured to connect to a SIM card. TheSIM card may be inserted into the SIM card interface 195 or removed fromthe SIM card interface 195, to implement contact with or separation fromthe electronic device 100. The electronic device 100 may support one orN SIM card interfaces, where N is a positive integer greater than 1. TheSIM card interface 195 can support a nano-SIM card, a micro-SIM card, aSIM card, and the like. A plurality of cards may be simultaneouslyinserted into a same SIM card interface 195. The plurality of cards maybe of a same type or of different types. The SIM card interface 195 mayalso be compatible with different types of SIM cards. The SIM cardinterface 195 may also be compatible with an external storage card. Theelectronic device 100 interacts with a network through the SIM card, toimplement functions such as calling and data communication. In someembodiments, the electronic device 100 uses an eSIM, that is, anembedded SIM card. The eSIM card may be embedded into the electronicdevice 100, and cannot be separated from the electronic device 100.

In some embodiments of this application, the display 194 may beconfigured to detect an operation used to initiate a call request toanother electronic device. In response to this operation, the processor110 selects, from audio devices available to the electronic device 100,an audio device that meets a user expectation as a voice pickup deviceand a voice play device. Herein, for a specific operation that theprocessor 110 selects the audio device that meets the user expectationas the voice pickup device and the voice play device, refer to relateddescriptions in the foregoing method embodiments.

In some embodiments of this application, the display 194 may beconfigured to detect an operation used to receive a call requestinitiated by another electronic device. In response to this operation,the processor 110 selects, from audio devices available to theelectronic device 100, an audio device that meets a user expectation asa voice pickup device and a voice play device. Herein, for a specificoperation that the processor 110 selects the audio device that meets theuser expectation as the voice pickup device and the voice play device,refer to related descriptions in the foregoing method embodiments.

In some embodiments of this application, the memory 121 may beconfigured to store a stack including audio devices available to theelectronic device 100. For detailed descriptions of the stack, refer torelated descriptions in the foregoing method embodiments. In someembodiments, the processor 110 may select, from the stack stored in thememory 121, an audio device with a highest priority as a voice pickupdevice and a voice play device.

A software system of the electronic device 100 may use a layeredarchitecture, an event-driven architecture, a microkernel architecture,a micro service architecture, or a cloud architecture. In thisembodiment of this application, an Android system of a layeredarchitecture is used as an example to describe a software structure ofthe electronic device 100.

FIG. 10B is a block diagram of a software structure of an electronicdevice 100 according to an embodiment of this application.

In the layered architecture, software is divided into several layers,and each layer has a clear role and task. The layers communicate witheach other through a software interface. In some embodiments, an Androidsystem is divided into four layers, that is, an application layer, anapplication framework layer, an Android runtime (Android runtime) andsystem library, and a kernel layer from top to bottom.

The application layer may include a series of application packages.

As shown in FIG. 10B, the application package may include applicationssuch as Camera, Gallery, Calendar, Phone, Map, Navigation, WLAN,Bluetooth, Music, Videos, and Messages.

The application framework layer provides an application programminginterface (application programming interface, API) and a programmingframework for an application at the application layer. The applicationframework layer includes some predefined functions.

As shown in FIG. 10B, the application framework layer may include awindow manager, a content provider, a view system, a phone manager, aresource manager, a notification manager, an audio manager, and thelike.

The window manager is configured to manage a window program. The windowmanager may obtain a size of a display, determine whether there is astatus bar, perform screen locking, take a screenshot, and the like.

The content provider is configured to: store and obtain data, and enablethe data to be accessed by an application. The data may include a video,an image, audio, calls that are made and received, a browsing historyand bookmarks, a phone book, and the like.

The view system includes visual controls, such as a control fordisplaying a text and a control for displaying a picture. The viewsystem may be configured to construct an application. A displayinterface may include one or more views. For example, a displayinterface including an SMS message notification icon may include a textdisplay view and a picture display view.

The phone manager is configured to provide communication functions ofthe electronic device 100, for example, management of a call status (forexample, dialing, answering, or hanging up) of the electronic device,obtaining of information (for example, device information, SIM cardinformation, and network information) about the electronic device, andlistening of a status (for example, signal strength) of the electronicdevice.

In this embodiment of this application, the audio manager may select,from audio devices available to the electronic device 100, an audiodevice that meets a user expectation as a voice pickup device and avoice play device of the electronic device 100 and another electronicdevice in a call process. In some embodiments, the audio manager may beconfigured to store a stack including audio devices available to theelectronic device 100. Further, the audio manager may select, from thestored stack, an audio device with a highest priority as a voice pickupdevice and a voice play device of the electronic device 100 and anotherelectronic device in a call process. Herein, for the stack stored in theaudio manager and a specific implementation in which the audio managerselects the voice pickup device and the voice play device, refer torelated descriptions in the foregoing method embodiments. Details arenot described herein again.

The resource manager provides various resources for an application, suchas a localized character string, an icon, a picture, a layout file, anda video file.

The notification manager enables an application to display notificationinformation in a status bar, and may be configured to convey anotification type message, where the displayed notification informationmay automatically disappear after a short pause without userinteraction. For example, the notification manager is configured tonotify download completion, provide a message notification, and thelike. The notification manager may alternatively be a notification thatappears in a top status bar of the system in a form of a graph or ascroll bar text, for example, a notification of an application runningon the background or a notification that appears on the screen in a formof a dialog window. For example, text information is prompted for in thestatus bar, an announcement is produced, the electronic device vibrates,or an indicator light blinks.

The Android runtime includes a core library and a virtual machine. TheAndroid runtime is responsible for scheduling and management of theAndroid system.

The core library includes two parts: a function that needs to be invokedin Java language and a core library of Android.

The application layer and the application framework layer run on thevirtual machine. The virtual machine executes Java files at theapplication layer and the application framework layer as binary files.The virtual machine is configured to implement functions such as objectlifecycle management, stack management, thread management, security andexception management, and garbage collection.

The system library may include a plurality of functional modules, forexample, a surface manager (surface manager), a media library (MediaLibraries), a three-dimensional graphics processing library (forexample, OpenGL ES), and a 2D graphics engine (for example, SGL).

The surface manager is configured to: manage a display subsystem andprovide fusion of 2D and 3D layers for a plurality of applications.

The media library supports playback and recording in a plurality ofcommonly used audio and video formats, static image files, and the like.The media library may support a plurality of audio and video codingformats, for example, MPEG-4, H.264, MP3, AAC, AMR, JPG, and PNG.

The three-dimensional graphics processing library is configured toimplement three-dimensional graphics drawing, image rendering,composition, layer processing, and the like.

The 2D graphics engine is a drawing engine for 2D drawing.

The kernel layer is a layer between hardware and software. The kernellayer includes at least a display driver, a camera driver, an audiodriver, and a sensor driver.

The following describes examples of working procedures of software andhardware of the electronic device 100 with reference to a photographingscenario.

When the touch sensor 180K receives a touch operation, a correspondinghardware interruption is sent to the kernel layer. The kernel layerprocesses the touch operation into an original input event (includinginformation such as touch coordinates and a timestamp of the touchoperation). The original input event is stored at the kernel layer. Theapplication framework layer obtains the original input event from thekernel layer, and identifies a control corresponding to the input event.For example, the touch operation is a single-tap touch operation and acontrol corresponding to the single-tap operation is a control of acamera application icon. A camera application invokes an interface atthe application framework layer, so that the camera application isopened. Then, a camera driver is started by invoking the kernel layer,and a static image or a video is captured by using the camera 193.

The implementations of this application may be randomly combined toachieve different technical effects.

All or some of the foregoing embodiments may be implemented by usingsoftware, hardware, firmware, or any combination thereof. When softwareis used to implement the embodiments, the embodiments may be implementedcompletely or partially in a form of a computer program product. Thecomputer program product includes one or more computer instructions.When the computer program instructions are loaded and executed on acomputer, the procedures or functions according to this application areall or partially generated. The computer may be a general-purposecomputer, a dedicated computer, a computer network, or anotherprogrammable apparatus. The computer instructions may be stored in acomputer-readable storage medium or may be transmitted from acomputer-readable storage medium to another computer-readable storagemedium. For example, the computer instructions may be transmitted from awebsite, computer, server, or data center to another website, computer,server, or data center in a wired (for example, a coaxial cable, anoptical fiber, or a digital subscriber line) or wireless (for example,infrared, radio, or microwave) manner. The computer-readable storagemedium may be any usable medium accessible by a computer, or a datastorage device, for example, a server or a data center, integrating oneor more usable media. The usable medium may be a magnetic medium (forexample, a floppy disk, a hard disk, or a magnetic tape), an opticalmedium (for example, a DVD), a semiconductor medium (for example, asolid-state drive (solid state disk)), or the like.

A person of ordinary skill in the art may understand that all or some ofthe procedures of the methods in the foregoing embodiments may beimplemented by a computer program instructing related hardware. Theprogram may be stored in a computer-readable storage medium. When theprogram is executed, the procedures of the methods in the foregoingembodiments may be performed. The storage medium includes any mediumthat can store program code, for example, a ROM, a random access memoryRAM, a magnetic disk, or an optical disc.

In conclusion, the foregoing descriptions are merely embodiments of thetechnical solutions of the present invention, but are not intended tolimit the protection scope of the present invention. Any modification,equivalent replacement, or improvement made according to the disclosureof the present invention shall fall within the protection scope of thepresent invention.

1-12. (canceled)
 13. An electronic device, wherein the electronic devicecomprises one or more processors and a memory; and the memory is coupledto the one or more processors, the memory is configured to storecomputer program code, the computer program code comprises computerinstructions, and the one or more processors invoke the computerinstructions to enable the electronic device to perform the followingoperations: connecting to a first external audio device; in response toa first operation received on the first external audio device,performing a first call process between the electronic device and asecond electronic device by using the first external audio device,wherein the first external audio device is configured to: in the firstcall process, collect audio around the electronic device, and play audioaround the second electronic device; ending the first call process;detecting a second operation entered on the electronic device, whereinthe second operation is used to receive a call request initiated by athird electronic device, or the second operation is used to initiate acall request to the third electronic device; and in response to thesecond operation, if the first external audio device is a default audiodevice, performing a second call process between the electronic deviceand the third electronic device by using the first external audiodevice, wherein the first external audio device is configured to: in thesecond call process, collect audio around the electronic device, andplay audio around the third electronic device.
 14. The electronic deviceaccording to claim 13, wherein a dial button or an answer button isdisposed on the first external audio device; and the first operationcomprises an operation performed on the dial button or an operationperformed on the answer button.
 15. The electronic device according toclaim 13, wherein the memory is further configured to store one or morepriorities of one or more audio devices, the one or more audio devicescomprise an audio device configured on the electronic device and anexternal audio device to which the electronic device is connected, andan audio device with a highest priority is configured to perform a callprocess between the electronic device and another electronic device; andthe one or more processors are further configured to invoke the computerinstructions to enable the electronic device to perform the followingstep: adjusting a priority of the first external audio device to thehighest in response to the first operation received on the firstexternal audio device.
 16. An electronic device, wherein the electronicdevice comprises one or more processors and a memory; and the memory iscoupled to the one or more processors, the memory is configured to storecomputer program code, the computer program code comprises computerinstructions, and the one or more processors invoke the computerinstructions to enable the electronic device to perform the followingoperations: performing a third call process between the electronicdevice and a fourth electronic device by using a first audio device,wherein the first audio device is configured to: in the third callprocess, collect audio around the electronic device, and play audioaround the fourth electronic device; detecting a third operation used toswitch to a second audio device; in response to the third operation,continuing performing the third call process by using the second audiodevice, wherein the second audio device is configured to: in the thirdcall process, continue collecting audio around the electronic device,and continue playing audio around the fourth electronic device; endingthe third call process; detecting a second operation entered on theelectronic device, wherein the second operation is used to receive acall request initiated by a third electronic device, or the secondoperation is used to initiate a call request to the third electronicdevice; and in response to the second operation, if the second audiodevice is a default audio device, performing a second call processbetween the electronic device and the third electronic device by usingthe second audio device, wherein the second audio device is configuredto: in the second call process, collect audio around the electronicdevice, and play audio around the third electronic device.
 17. Theelectronic device according to claim 16, wherein the electronic devicefurther comprises a display, and the one or more processors are furtherconfigured to invoke the computer instructions to enable the electronicdevice to perform the following operations: before detecting, in thethird call process that is between the electronic device and the fourthelectronic device and that is performed by using the first audio device,the third operation used to switch to a second audio device, displayinga first user interface on the display, wherein the first user interfacecomprises a control for switching an audio device; and displaying one ormore audio device options on the display in response to an operationdetected on the control for switching an audio device, wherein the oneor more audio device options comprise an option of an audio deviceconfigured on the electronic device and an option of an external audiodevice to which the electronic device is connected, and the one or moreaudio device options comprise an option of the second audio device; andthe third operation used to switch to a second audio device comprises anoperation performed on the option of the second audio device.
 18. Theelectronic device according to claim 16, wherein the memory is furtherconfigured to store one or more priorities of one or more audio devices,the one or more audio devices comprise an audio device configured on theelectronic device and an external audio device to which the electronicdevice is connected, and an audio device with a highest priority isconfigured to perform a call process between the electronic device andanother electronic device; and the one or more processors are furtherconfigured to invoke the computer instructions to enable the electronicdevice to perform the following step: adjusting a priority of the secondaudio device to the highest in response to the third operation.
 19. Theelectronic device according to claim 13, wherein the one or moreprocessors are further configured to invoke the computer instructions toenable the electronic device to perform the following operations: endingthe second call process after performing the second call process betweenthe electronic device and the third electronic device; connecting to asecond external audio device; detecting a fourth operation entered onthe electronic device, wherein the fourth operation is used to receive acall request initiated by a fifth electronic device, or the fourthoperation is used to initiate a call request to the fifth electronicdevice; and in response to the fourth operation, if the second externalaudio device is a default audio device, performing a fourth call processbetween the electronic device and the fifth electronic device by usingthe second external audio device, wherein the second external audiodevice is configured to: in the fourth call process, collect audioaround the electronic device, and play audio around the fifth electronicdevice.
 20. The electronic device according to claim 19, wherein thememory is further configured to store one or more priorities of one ormore audio devices, the one or more audio devices comprise an audiodevice configured on the electronic device and an external audio deviceto which the electronic device is connected, and an audio device with ahighest priority is configured to perform a call process between theelectronic device and another electronic device; and the one or moreprocessors are further configured to invoke the computer instructions toenable the electronic device to perform the following step: afterconnecting to the second external audio device, if the second externalaudio device is the default audio device, adjusting a priority of thesecond external audio device to the highest.
 21. The electronic deviceaccording to claim 13, wherein the one or more processors are furtherconfigured to invoke the computer instructions to enable the electronicdevice to perform the following operations: ending the second callprocess after performing the second call process between the electronicdevice and the third electronic device; detecting a fifth operation,wherein the fifth operation is used to receive a call request initiatedby a sixth electronic device, or the fifth operation is used to initiatea call request to the sixth electronic device; displaying one or moreaudio device options and an OK control in response to the fifthoperation, wherein the one or more audio device options comprise anoption of an audio device configured on the electronic device and anoption of an external audio device to which the electronic device isconnected, and the one or more audio device options comprise an optionof a third audio device; after detecting an operation of selecting theoption of the third audio device, detecting a sixth operation performedon the OK control, and in response to the sixth operation, performing afifth call process between the electronic device and the sixthelectronic device by using the third audio device, wherein the thirdaudio device is configured to: in the fifth call process, collect audioaround the electronic device, and play audio around the sixth electronicdevice; ending the fifth call process; detecting a seventh operationentered on the electronic device, wherein the seventh operation is usedto receive a call request initiated by a seventh electronic device, orthe seventh operation is used to initiate a call request to the seventhelectronic device; and in response to the seventh operation, if thethird audio device is a default audio device, performing a sixth callprocess between the electronic device and the seventh electronic deviceby using the third audio device, wherein the third audio device isconfigured to: in the sixth call process, collect audio around theelectronic device, and play audio around the seventh electronic device.22. The electronic device according to claim 21, wherein the memory isfurther configured to store one or more priorities of one or more audiodevices, the one or more audio devices comprise an audio deviceconfigured on the electronic device and an external audio device towhich the electronic device is connected, and an audio device with ahighest priority is configured to perform a call process between theelectronic device and another electronic device; and the one or moreprocessors are further configured to invoke the computer instructions toenable the electronic device to perform the following step: adjusting apriority of the third audio device to the highest in response to thesixth operation.
 23. The electronic device according to claim 13,wherein the electronic device further comprises a display, and the oneor more processors are further configured to invoke the computerinstructions to enable the electronic device to perform the followingoperations: before detecting the second operation entered on theelectronic device, receiving the call request initiated by the thirdelectronic device, and displaying a second user interface on the displayin response to the call request, wherein the second user interfacecomprises an answer control and a hang-up control, and the secondoperation comprises an operation performed on the answer control; orbefore detecting the second operation entered on the electronic device,displaying a third user interface on the display, wherein the third userinterface comprises an identifier associated with the third electronicdevice and a dial control, and the second operation comprises anoperation performed on the dial control.
 24. The electronic deviceaccording to claim 13, wherein the default audio device comprises anaudio device whose maximum decibel value existing during audio play isless than a threshold.
 25. (canceled)
 26. A computer-readable storagemedium, comprising instructions, wherein when the instructions are runon an electronic device, the electronic device is enabled to perform thefollowing operations: connecting to a first external audio device; inresponse to a first operation received on the first external audiodevice, performing a first call process between the electronic deviceand a second electronic device by using the first external audio device,wherein the first external audio device is configured to: in the firstcall process, collect audio around the electronic device, and play audioaround the second electronic device; ending the first call process;detecting a second operation entered on the electronic device, whereinthe second operation is used to receive a call request initiated by athird electronic device, or the second operation is used to initiate acall request to the third electronic device; and in response to thesecond operation, if the first external audio device is a default audiodevice, performing a second call process between the electronic deviceand the third electronic device by using the first external audiodevice, wherein the first external audio device is configured to: in thesecond call process, collect audio around the electronic device, andplay audio around the third electronic device.